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

Comparing jsr166/src/test/tck/ConcurrentLinkedQueueTest.java (file contents):
Revision 1.41 by jsr166, Sun Oct 16 20:16:36 2016 UTC vs.
Revision 1.46 by jsr166, Mon May 29 22:44:26 2017 UTC

# Line 14 | Line 14 | import java.util.Queue;
14   import java.util.concurrent.ConcurrentLinkedQueue;
15  
16   import junit.framework.Test;
17 import junit.framework.TestSuite;
17  
18   public class ConcurrentLinkedQueueTest extends JSR166TestCase {
19  
# Line 36 | Line 35 | public class ConcurrentLinkedQueueTest e
35  
36      /**
37       * Returns a new queue of given size containing consecutive
38 <     * Integers 0 ... n.
38 >     * Integers 0 ... n - 1.
39       */
40 <    private ConcurrentLinkedQueue<Integer> populatedQueue(int n) {
41 <        ConcurrentLinkedQueue<Integer> q = new ConcurrentLinkedQueue<Integer>();
40 >    private static ConcurrentLinkedQueue<Integer> populatedQueue(int n) {
41 >        ConcurrentLinkedQueue<Integer> q = new ConcurrentLinkedQueue<>();
42          assertTrue(q.isEmpty());
43          for (int i = 0; i < n; ++i)
44              assertTrue(q.offer(new Integer(i)));
45          assertFalse(q.isEmpty());
46          assertEquals(n, q.size());
47 +        assertEquals((Integer) 0, q.peek());
48          return q;
49      }
50  
# Line 172 | Line 172 | public class ConcurrentLinkedQueueTest e
172      }
173  
174      /**
175 <     * addAll(null) throws NPE
175 >     * addAll(null) throws NullPointerException
176       */
177      public void testAddAll1() {
178          ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
# Line 183 | Line 183 | public class ConcurrentLinkedQueueTest e
183      }
184  
185      /**
186 <     * addAll(this) throws IAE
186 >     * addAll(this) throws IllegalArgumentException
187       */
188      public void testAddAllSelf() {
189          ConcurrentLinkedQueue q = populatedQueue(SIZE);
# Line 194 | Line 194 | public class ConcurrentLinkedQueueTest e
194      }
195  
196      /**
197 <     * addAll of a collection with null elements throws NPE
197 >     * addAll of a collection with null elements throws NullPointerException
198       */
199      public void testAddAll2() {
200          ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines