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.15 by jsr166, Wed Aug 25 00:07:03 2010 UTC vs.
Revision 1.18 by jsr166, Fri May 27 19:26:42 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   * Other contributors include Andrew Wright, Jeffrey Hayes,
6   * Pat Fisher, Mike Judd.
7   */
# Line 49 | Line 49 | public class CopyOnWriteArraySetTest ext
49              assertTrue(a.contains(ints[i]));
50      }
51  
52
52      /**
53 <     *  addAll 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 64 | Line 63 | public class CopyOnWriteArraySetTest ext
63      }
64  
65      /**
66 <     *  addAll adds each element from the given collection that did not
67 <     *  already exist in the set
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 78 | Line 77 | public class CopyOnWriteArraySetTest ext
77      }
78  
79      /**
80 <     *  add will not add the element if it already exists in the set
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 87 | Line 86 | public class CopyOnWriteArraySetTest ext
86      }
87  
88      /**
89 <     *  add  adds the element when it does not exist
91 <     *  in the set
89 >     * add adds the element when it does not exist in the set
90       */
91      public void testAdd3() {
92          CopyOnWriteArraySet full = populatedSet(3);
# Line 97 | Line 95 | public class CopyOnWriteArraySetTest ext
95      }
96  
97      /**
98 <     *  clear removes all elements from the set
98 >     * clear removes all elements from the set
99       */
100      public void testClear() {
101          CopyOnWriteArraySet full = populatedSet(3);
# Line 106 | Line 104 | public class CopyOnWriteArraySetTest ext
104      }
105  
106      /**
107 <     *   contains returns true for added elements
107 >     * contains returns true for added elements
108       */
109      public void testContains() {
110          CopyOnWriteArraySet full = populatedSet(3);
# Line 132 | Line 130 | public class CopyOnWriteArraySetTest ext
130          assertEquals(a.hashCode(), b.hashCode());
131      }
132  
135
133      /**
134 <     *  containsAll returns true for collections with subset of elements
134 >     * containsAll returns true for collections with subset of elements
135       */
136      public void testContainsAll() {
137          CopyOnWriteArraySet full = populatedSet(3);
# Line 147 | Line 144 | public class CopyOnWriteArraySetTest ext
144      }
145  
146      /**
147 <     *  isEmpty is true when empty, else false
147 >     * isEmpty is true when empty, else false
148       */
149      public void testIsEmpty() {
150          CopyOnWriteArraySet empty = new CopyOnWriteArraySet();
# Line 157 | Line 154 | public class CopyOnWriteArraySetTest ext
154      }
155  
156      /**
157 <     *  iterator() returns an iterator containing the elements of the set
157 >     * iterator() returns an iterator containing the elements of the set
158       */
159      public void testIterator() {
160          CopyOnWriteArraySet full = populatedSet(3);
# Line 188 | Line 185 | public class CopyOnWriteArraySetTest ext
185          CopyOnWriteArraySet full = populatedSet(3);
186          String s = full.toString();
187          for (int i = 0; i < 3; ++i) {
188 <            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
188 >            assertTrue(s.contains(String.valueOf(i)));
189          }
190      }
191  
195
192      /**
193 <     *  removeAll  removes all elements from the given collection
193 >     * removeAll removes all elements from the given collection
194       */
195      public void testRemoveAll() {
196          CopyOnWriteArraySet full = populatedSet(3);
# Line 205 | Line 201 | public class CopyOnWriteArraySetTest ext
201          assertEquals(1, full.size());
202      }
203  
208
204      /**
205       * remove removes an element
206       */
# Line 217 | Line 212 | public class CopyOnWriteArraySetTest ext
212      }
213  
214      /**
215 <     *  size returns the number of elements
215 >     * size returns the number of elements
216       */
217      public void testSize() {
218          CopyOnWriteArraySet empty = new CopyOnWriteArraySet();
# Line 227 | Line 222 | public class CopyOnWriteArraySetTest ext
222      }
223  
224      /**
225 <     *  toArray returns an Object array containing all elements from the set
225 >     * toArray returns an Object array containing all elements from the set
226       */
227      public void testToArray() {
228          CopyOnWriteArraySet full = populatedSet(3);
# Line 239 | Line 234 | public class CopyOnWriteArraySetTest ext
234      }
235  
236      /**
237 <     *  toArray returns an Integer array containing all elements from
238 <     *  the set
237 >     * toArray returns an Integer array containing all elements from
238 >     * the set
239       */
240      public void testToArray2() {
241          CopyOnWriteArraySet full = populatedSet(3);
# Line 252 | Line 247 | public class CopyOnWriteArraySetTest ext
247          assertEquals(2, (int) i[2]);
248      }
249  
255
250      /**
251 <     *  toArray throws an ArrayStoreException when the given array can
252 <     *  not store the objects inside the set
251 >     * toArray throws an ArrayStoreException when the given array can
252 >     * not store the objects inside the set
253       */
254      public void testToArray_ArrayStoreException() {
255          try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines