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.7 by dl, Mon Dec 29 19:05:40 2003 UTC vs.
Revision 1.8 by jsr166, Mon Nov 2 20:28:31 2009 UTC

# Line 2 | Line 2
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
5 < * Other contributors include Andrew Wright, Jeffrey Hayes,
6 < * Pat Fisher, Mike Judd.
5 > * Other contributors include Andrew Wright, Jeffrey Hayes,
6 > * Pat Fisher, Mike Judd.
7   */
8  
9   import junit.framework.*;
# Line 13 | Line 13 | import java.io.*;
13  
14   public class CopyOnWriteArraySetTest extends JSR166TestCase {
15      public static void main(String[] args) {
16 <        junit.textui.TestRunner.run (suite());  
16 >        junit.textui.TestRunner.run (suite());
17      }
18      public static Test suite() {
19          return new TestSuite(CopyOnWriteArraySetTest.class);
# Line 22 | Line 22 | public class CopyOnWriteArraySetTest ext
22      static CopyOnWriteArraySet populatedSet(int n){
23          CopyOnWriteArraySet a = new CopyOnWriteArraySet();
24          assertTrue(a.isEmpty());
25 <        for (int i = 0; i < n; ++i)
25 >        for (int i = 0; i < n; ++i)
26              a.add(new Integer(i));
27          assertFalse(a.isEmpty());
28          assertEquals(n, a.size());
# Line 45 | Line 45 | public class CopyOnWriteArraySetTest ext
45          for (int i = 0; i < SIZE-1; ++i)
46              ints[i] = new Integer(i);
47          CopyOnWriteArraySet a = new CopyOnWriteArraySet(Arrays.asList(ints));
48 <        for (int i = 0; i < SIZE; ++i)
48 >        for (int i = 0; i < SIZE; ++i)
49              assertTrue(a.contains(ints[i]));
50      }
51 <        
51 >
52  
53      /**
54       *   addAll  adds each element from the given collection
# Line 132 | Line 132 | public class CopyOnWriteArraySetTest ext
132          assertEquals(a.hashCode(), b.hashCode());
133      }
134  
135 <    
135 >
136      /**
137       *   containsAll returns true for collections with subset of elements
138       */
# Line 157 | Line 157 | public class CopyOnWriteArraySetTest ext
157      }
158  
159      /**
160 <     *   iterator() returns an iterator containing the elements of the set
160 >     *   iterator() returns an iterator containing the elements of the set
161       */
162      public void testIterator() {
163          CopyOnWriteArraySet full = populatedSet(3);
# Line 191 | Line 191 | public class CopyOnWriteArraySetTest ext
191          for (int i = 0; i < 3; ++i) {
192              assertTrue(s.indexOf(String.valueOf(i)) >= 0);
193          }
194 <    }        
194 >    }
195  
196  
197      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines