--- jsr166/src/test/tck/DelayQueueTest.java 2009/11/21 22:00:46 1.24 +++ jsr166/src/test/tck/DelayQueueTest.java 2009/11/22 00:17:37 1.25 @@ -415,14 +415,17 @@ public class DelayQueueTest extends JSR1 * Take removes existing elements until empty, then blocks interruptibly */ public void testBlockingTake() throws InterruptedException { - Thread t = new ThreadShouldThrow(InterruptedException.class) { + final DelayQueue q = populatedQueue(SIZE); + Thread t = new Thread(new CheckedRunnable() { public void realRun() throws InterruptedException { - DelayQueue q = populatedQueue(SIZE); for (int i = 0; i < SIZE; ++i) { - threadAssertEquals(new PDelay(i), ((PDelay)q.take())); + assertEquals(new PDelay(i), ((PDelay)q.take())); } - q.take(); - }}; + try { + q.take(); + shouldThrow(); + } catch (InterruptedException success) {} + }}); t.start(); Thread.sleep(SHORT_DELAY_MS);