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.93 by jsr166, Sun Aug 11 22:29:26 2019 UTC vs.
Revision 1.96 by jsr166, Thu Sep 5 21:11:13 2019 UTC

# Line 34 | Line 34 | public class ArrayBlockingQueueTest exte
34          class Implementation implements CollectionImplementation {
35              public Class<?> klazz() { return ArrayBlockingQueue.class; }
36              public Collection emptyCollection() {
37 <                boolean fair = ThreadLocalRandom.current().nextBoolean();
37 >                boolean fair = randomBoolean();
38                  return populatedQueue(0, SIZE, 2 * SIZE, fair);
39              }
40              public Object makeElement(int i) { return i; }
# Line 411 | Line 411 | public class ArrayBlockingQueueTest exte
411  
412                  pleaseInterrupt.countDown();
413                  try {
414 <                    q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
414 >                    q.offer(new Object(), LONGER_DELAY_MS, MILLISECONDS);
415                      shouldThrow();
416                  } catch (InterruptedException success) {}
417                  assertFalse(Thread.interrupted());
418
419                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
418              }});
419  
420          await(pleaseInterrupt);
# Line 514 | Line 512 | public class ArrayBlockingQueueTest exte
512          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
513          Thread t = newStartedThread(new CheckedRunnable() {
514              public void realRun() throws InterruptedException {
517                long startTime = System.nanoTime();
515                  for (int i = 0; i < SIZE; i++)
516                      assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
517  
# Line 527 | Line 524 | public class ArrayBlockingQueueTest exte
524  
525                  pleaseInterrupt.countDown();
526                  try {
527 <                    q.poll(LONG_DELAY_MS, MILLISECONDS);
527 >                    q.poll(LONGER_DELAY_MS, MILLISECONDS);
528                      shouldThrow();
529                  } catch (InterruptedException success) {}
530                  assertFalse(Thread.interrupted());
534
535                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
531              }});
532  
533          await(pleaseInterrupt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines