01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.test;
05:
06: import java.util.ArrayList;
07: import java.util.Iterator;
08: import java.util.List;
09:
10: public class TestFailureSet {
11: private final List list = new ArrayList();
12:
13: public void put(TestFailure f) {
14: synchronized (list) {
15: list.add(f);
16: }
17: }
18:
19: public String toString() {
20: StringBuffer buf = new StringBuffer("Test failures...\n");
21: synchronized (list) {
22: for (Iterator i = list.iterator(); i.hasNext();) {
23: TestFailure f = (TestFailure) i.next();
24: buf.append(f + "\n");
25: }
26: }
27: return buf.toString();
28: }
29:
30: public int size() {
31: synchronized (list) {
32: return list.size();
33: }
34: }
35: }
|