439 |
|
* returning timeout status |
440 |
|
*/ |
441 |
|
public void testInterruptedTimedPoll() throws InterruptedException { |
442 |
< |
Thread t = new ThreadShouldThrow(InterruptedException.class) { |
442 |
> |
Thread t = new Thread(new CheckedRunnable() { |
443 |
|
public void realRun() throws InterruptedException { |
444 |
|
LinkedBlockingQueue q = populatedQueue(SIZE); |
445 |
|
for (int i = 0; i < SIZE; ++i) { |
446 |
< |
threadAssertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, MILLISECONDS)).intValue()); |
446 |
> |
assertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, MILLISECONDS)).intValue()); |
447 |
|
} |
448 |
< |
q.poll(SMALL_DELAY_MS, MILLISECONDS); |
449 |
< |
}}; |
448 |
> |
try { |
449 |
> |
q.poll(SMALL_DELAY_MS, MILLISECONDS); |
450 |
> |
shouldThrow(); |
451 |
> |
} catch (InterruptedException success) {} |
452 |
> |
}}); |
453 |
|
|
454 |
|
t.start(); |
455 |
|
Thread.sleep(SHORT_DELAY_MS); |