ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CopyOnWriteArraySetTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CopyOnWriteArraySetTest.java (file contents):
Revision 1.4 by dl, Sat Sep 20 18:20:07 2003 UTC vs.
Revision 1.5 by dl, Thu Sep 25 11:02:41 2003 UTC

# Line 11 | Line 11 | import java.util.concurrent.*;
11   import java.io.*;
12  
13   public class CopyOnWriteArraySetTest extends JSR166TestCase {
14    
14      public static void main(String[] args) {
15          junit.textui.TestRunner.run (suite());  
16      }
18
17      public static Test suite() {
18          return new TestSuite(CopyOnWriteArraySetTest.class);
19      }
# Line 39 | Line 37 | public class CopyOnWriteArraySetTest ext
37      }
38  
39      /**
40 <     * Collection-constructed list holds all of its elements
40 >     * Collection-constructed set holds all of its elements
41       */
42      public void testConstructor3() {
43          Integer[] ints = new Integer[SIZE];
# Line 52 | Line 50 | public class CopyOnWriteArraySetTest ext
50          
51  
52      /**
53 <     *   addAll correctly adds each element from the given collection
53 >     *   addAll  adds each element from the given collection
54       */
55      public void testAddAll() {
56          CopyOnWriteArraySet full = populatedSet(3);
# Line 65 | Line 63 | public class CopyOnWriteArraySetTest ext
63      }
64  
65      /**
66 <     *   addAllAbsent adds each element from the given collection that did not
67 <     *  already exist in the List
66 >     *   addAll adds each element from the given collection that did not
67 >     *  already exist in the set
68       */
69      public void testAddAll2() {
70          CopyOnWriteArraySet full = populatedSet(3);
# Line 79 | Line 77 | public class CopyOnWriteArraySetTest ext
77      }
78  
79      /**
80 <     *   addIfAbsent will not add the element if it already exists in the list
80 >     *   add will not add the element if it already exists in the set
81       */
82      public void testAdd2() {
83          CopyOnWriteArraySet full = populatedSet(3);
# Line 88 | Line 86 | public class CopyOnWriteArraySetTest ext
86      }
87  
88      /**
89 <     *   addIfAbsent correctly adds the element when it does not exist
90 <     *   in the list
89 >     *   add  adds the element when it does not exist
90 >     *   in the set
91       */
92      public void testAdd3() {
93          CopyOnWriteArraySet full = populatedSet(3);
# Line 98 | Line 96 | public class CopyOnWriteArraySetTest ext
96      }
97  
98      /**
99 <     *   clear correctly removes all elements from the list
99 >     *   clear  removes all elements from the set
100       */
101      public void testClear() {
102          CopyOnWriteArraySet full = populatedSet(3);
# Line 107 | Line 105 | public class CopyOnWriteArraySetTest ext
105      }
106  
107      /**
108 <     *   contains returns the correct values
108 >     *   contains returns true for added elements
109       */
110      public void testContains() {
111          CopyOnWriteArraySet full = populatedSet(3);
# Line 135 | Line 133 | public class CopyOnWriteArraySetTest ext
133  
134      
135      /**
136 <     *   containsAll returns the correct values
136 >     *   containsAll returns true for collections with subset of elements
137       */
138      public void testContainsAll() {
139          CopyOnWriteArraySet full = populatedSet(3);
# Line 148 | Line 146 | public class CopyOnWriteArraySetTest ext
146      }
147  
148      /**
149 <     *   isEmpty returns the correct values
149 >     *   isEmpty is true when empty, else false
150       */
151      public void testIsEmpty() {
152          CopyOnWriteArraySet empty = new CopyOnWriteArraySet();
# Line 158 | Line 156 | public class CopyOnWriteArraySetTest ext
156      }
157  
158      /**
159 <     *   iterator() returns an iterator containing the elements of the list
159 >     *   iterator() returns an iterator containing the elements of the set
160       */
161      public void testIterator() {
162          CopyOnWriteArraySet full = populatedSet(3);
# Line 196 | Line 194 | public class CopyOnWriteArraySetTest ext
194  
195  
196      /**
197 <     *   removeAll correctly removes all elements from the given collection
197 >     *   removeAll  removes all elements from the given collection
198       */
199      public void testRemoveAll() {
200          CopyOnWriteArraySet full = populatedSet(3);
# Line 219 | Line 217 | public class CopyOnWriteArraySetTest ext
217      }
218  
219      /**
220 <     *   size returns the correct values
220 >     *   size returns the number of elements
221       */
222      public void testSize() {
223          CopyOnWriteArraySet empty = new CopyOnWriteArraySet();
# Line 229 | Line 227 | public class CopyOnWriteArraySetTest ext
227      }
228  
229      /**
230 <     *   toArray returns an Object array containing all elements from the list
230 >     *   toArray returns an Object array containing all elements from the set
231       */
232      public void testToArray() {
233          CopyOnWriteArraySet full = populatedSet(3);
# Line 242 | Line 240 | public class CopyOnWriteArraySetTest ext
240  
241      /**
242       *   toArray returns an Integer array containing all elements from
243 <     *   the list
243 >     *   the set
244       */
245      public void testToArray2() {
246          CopyOnWriteArraySet full = populatedSet(3);
# Line 257 | Line 255 | public class CopyOnWriteArraySetTest ext
255  
256      /**
257       *  toArray throws an ArrayStoreException when the given array can
258 <     *  not store the objects inside the list
258 >     *  not store the objects inside the set
259       */
260      public void testToArray_ArrayStoreException() {
261          try {
# Line 270 | Line 268 | public class CopyOnWriteArraySetTest ext
268      }
269  
270      /**
271 <     *
271 >     * A deserialized seriealized set is equal
272       */
273      public void testSerialization() {
274          CopyOnWriteArraySet q = populatedSet(SIZE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines