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

Comparing jsr166/src/test/tck/ArrayBlockingQueueTest.java (file contents):
Revision 1.70 by jsr166, Tue Oct 6 00:03:55 2015 UTC vs.
Revision 1.73 by jsr166, Mon Oct 17 01:52:04 2016 UTC

# Line 41 | Line 41 | public class ArrayBlockingQueueTest exte
41      }
42  
43      public static Test suite() {
44 +        class Implementation implements CollectionImplementation {
45 +            public Class<?> klazz() { return ArrayBlockingQueue.class; }
46 +            public Collection emptyCollection() { return new ArrayBlockingQueue(SIZE, false); }
47 +            public Object makeElement(int i) { return i; }
48 +            public boolean isConcurrent() { return true; }
49 +            public boolean permitsNulls() { return false; }
50 +        }
51          return newTestSuite(ArrayBlockingQueueTest.class,
52                              new Fair().testSuite(),
53 <                            new NonFair().testSuite());
53 >                            new NonFair().testSuite(),
54 >                            CollectionTest.testSuite(new Implementation()));
55      }
56  
57      /**
58       * Returns a new queue of given size containing consecutive
59 <     * Integers 0 ... n.
59 >     * Integers 0 ... n - 1.
60       */
61      private ArrayBlockingQueue<Integer> populatedQueue(int n) {
62          ArrayBlockingQueue<Integer> q = new ArrayBlockingQueue<Integer>(n);
# Line 58 | Line 66 | public class ArrayBlockingQueueTest exte
66          assertFalse(q.isEmpty());
67          assertEquals(0, q.remainingCapacity());
68          assertEquals(n, q.size());
69 +        assertEquals((Integer) 0, q.peek());
70          return q;
71      }
72  
# Line 465 | Line 474 | public class ArrayBlockingQueueTest exte
474              }});
475  
476          await(aboutToWait);
477 <        waitForThreadToEnterWaitState(t, LONG_DELAY_MS);
477 >        waitForThreadToEnterWaitState(t);
478          t.interrupt();
479          awaitTermination(t);
480          checkEmpty(q);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines