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

Comparing jsr166/src/test/tck/ConcurrentLinkedDequeTest.java (file contents):
Revision 1.15 by jsr166, Wed Dec 31 20:09:08 2014 UTC vs.
Revision 1.19 by jsr166, Sat Apr 25 04:55:30 2015 UTC

# Line 21 | Line 21 | import junit.framework.TestSuite;
21   public class ConcurrentLinkedDequeTest extends JSR166TestCase {
22  
23      public static void main(String[] args) {
24 <        junit.textui.TestRunner.run(suite());
24 >        main(suite(), args);
25      }
26  
27      public static Test suite() {
# Line 55 | Line 55 | public class ConcurrentLinkedDequeTest e
55       */
56      public void testConstructor3() {
57          try {
58 <            ConcurrentLinkedDeque q = new ConcurrentLinkedDeque((Collection)null);
58 >            new ConcurrentLinkedDeque((Collection)null);
59              shouldThrow();
60          } catch (NullPointerException success) {}
61      }
# Line 66 | Line 66 | public class ConcurrentLinkedDequeTest e
66      public void testConstructor4() {
67          try {
68              Integer[] ints = new Integer[SIZE];
69 <            ConcurrentLinkedDeque q = new ConcurrentLinkedDeque(Arrays.asList(ints));
69 >            new ConcurrentLinkedDeque(Arrays.asList(ints));
70              shouldThrow();
71          } catch (NullPointerException success) {}
72      }
# Line 79 | Line 79 | public class ConcurrentLinkedDequeTest e
79              Integer[] ints = new Integer[SIZE];
80              for (int i = 0; i < SIZE-1; ++i)
81                  ints[i] = new Integer(i);
82 <            ConcurrentLinkedDeque q = new ConcurrentLinkedDeque(Arrays.asList(ints));
82 >            new ConcurrentLinkedDeque(Arrays.asList(ints));
83              shouldThrow();
84          } catch (NullPointerException success) {}
85      }
# Line 641 | Line 641 | public class ConcurrentLinkedDequeTest e
641              assertTrue(q.removeAll(p));
642              assertEquals(SIZE-i, q.size());
643              for (int j = 0; j < i; ++j) {
644 <                Integer I = (Integer)(p.remove());
645 <                assertFalse(q.contains(I));
644 >                Integer x = (Integer)(p.remove());
645 >                assertFalse(q.contains(x));
646              }
647          }
648      }
# Line 696 | Line 696 | public class ConcurrentLinkedDequeTest e
696       */
697      public void testIterator() {
698          ConcurrentLinkedDeque q = populatedDeque(SIZE);
699        int i = 0;
699          Iterator it = q.iterator();
700 <        while (it.hasNext()) {
700 >        int i;
701 >        for (i = 0; it.hasNext(); i++)
702              assertTrue(q.contains(it.next()));
703            ++i;
704        }
703          assertEquals(i, SIZE);
704 +        assertIteratorExhausted(it);
705 +    }
706 +
707 +    /**
708 +     * iterator of empty collection has no elements
709 +     */
710 +    public void testEmptyIterator() {
711 +        Deque c = new ConcurrentLinkedDeque();
712 +        assertIteratorExhausted(c.iterator());
713 +        assertIteratorExhausted(c.descendingIterator());
714      }
715  
716      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines