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

Comparing jsr166/src/test/tck/CopyOnWriteArrayListTest.java (file contents):
Revision 1.30 by jsr166, Fri Jan 31 17:58:35 2014 UTC vs.
Revision 1.32 by jsr166, Sat Jan 17 22:55:06 2015 UTC

# Line 6 | Line 6
6   * Pat Fisher, Mike Judd.
7   */
8  
9 import junit.framework.*;
9   import java.util.ArrayList;
10   import java.util.Arrays;
11   import java.util.Collection;
# Line 19 | Line 18 | import java.util.NoSuchElementException;
18   import java.util.Vector;
19   import java.util.concurrent.CopyOnWriteArrayList;
20  
21 + import junit.framework.Test;
22 + import junit.framework.TestSuite;
23 +
24   public class CopyOnWriteArrayListTest extends JSR166TestCase {
25  
26      public static void main(String[] args) {
# Line 262 | Line 264 | public class CopyOnWriteArrayListTest ex
264              assertTrue(it.hasNext());
265              assertEquals(elements[j], it.next());
266          }
267 <        assertFalse(it.hasNext());
268 <        try {
269 <            it.next();
270 <            shouldThrow();
271 <        } catch (NoSuchElementException success) {}
267 >        assertIteratorExhausted(it);
268 >    }
269 >
270 >    /**
271 >     * iterator of empty collection has no elements
272 >     */
273 >    public void testEmptyIterator() {
274 >        Collection c = new CopyOnWriteArrayList();
275 >        assertIteratorExhausted(c.iterator());
276      }
277  
278      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines