234 |
|
} |
235 |
|
|
236 |
|
/** |
237 |
< |
* addAll(this) throws IAE |
237 |
> |
* addAll(this) throws IllegalArgumentException |
238 |
|
*/ |
239 |
|
public void testAddAllSelf() { |
240 |
|
DelayQueue q = populatedQueue(SIZE); |
410 |
|
Thread t = newStartedThread(new CheckedRunnable() { |
411 |
|
public void realRun() throws InterruptedException { |
412 |
|
long startTime = System.nanoTime(); |
413 |
< |
for (int i = 0; i < SIZE; ++i) { |
413 |
> |
for (int i = 0; i < SIZE; i++) |
414 |
|
assertEquals(new PDelay(i), |
415 |
|
((PDelay)q.poll(LONG_DELAY_MS, MILLISECONDS))); |
416 |
– |
} |
416 |
|
|
417 |
|
Thread.currentThread().interrupt(); |
418 |
|
try { |
427 |
|
shouldThrow(); |
428 |
|
} catch (InterruptedException success) {} |
429 |
|
assertFalse(Thread.interrupted()); |
430 |
+ |
|
431 |
|
assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); |
432 |
|
}}); |
433 |
|
|
434 |
|
await(pleaseInterrupt); |
435 |
< |
assertThreadStaysAlive(t); |
435 |
> |
assertThreadBlocks(t, Thread.State.TIMED_WAITING); |
436 |
|
t.interrupt(); |
437 |
|
awaitTermination(t); |
438 |
|
checkEmpty(q); |