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); |
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 |
|
|
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); |
688 |
|
Integer x = (Integer) it.next(); |
689 |
|
assertEquals(s + i, (int) x); |
690 |
|
for (Object[] a : as) |
691 |
< |
assertSame(a1[i], x); |
691 |
> |
assertSame(a[i], x); |
692 |
|
} |
693 |
|
} |
694 |
|
|