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

Comparing jsr166/src/test/tck/PriorityBlockingQueueTest.java (file contents):
Revision 1.70 by jsr166, Tue Nov 22 16:48:36 2016 UTC vs.
Revision 1.73 by jsr166, Sat May 13 21:43:51 2017 UTC

# Line 66 | Line 66 | public class PriorityBlockingQueueTest e
66       * Returns a new queue of given size containing consecutive
67       * Integers 0 ... n - 1.
68       */
69 <    private PriorityBlockingQueue<Integer> populatedQueue(int n) {
69 >    private static PriorityBlockingQueue<Integer> populatedQueue(int n) {
70          PriorityBlockingQueue<Integer> q =
71              new PriorityBlockingQueue<Integer>(n);
72          assertTrue(q.isEmpty());
# Line 333 | Line 333 | public class PriorityBlockingQueueTest e
333          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
334          Thread t = newStartedThread(new CheckedRunnable() {
335              public void realRun() throws InterruptedException {
336 <                for (int i = 0; i < SIZE; ++i) {
337 <                    assertEquals(i, q.take());
338 <                }
336 >                for (int i = 0; i < SIZE; i++) assertEquals(i, q.take());
337  
338                  Thread.currentThread().interrupt();
339                  try {
# Line 353 | Line 351 | public class PriorityBlockingQueueTest e
351              }});
352  
353          await(pleaseInterrupt);
354 <        assertThreadStaysAlive(t);
354 >        assertThreadBlocks(t, Thread.State.WAITING);
355          t.interrupt();
356          awaitTermination(t);
357      }
# Line 418 | Line 416 | public class PriorityBlockingQueueTest e
416                  }
417              }});
418  
419 <        aboutToWait.await();
419 >        await(aboutToWait);
420          waitForThreadToEnterWaitState(t);
421          t.interrupt();
422          awaitTermination(t);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines