--- jsr166/src/test/tck/LinkedBlockingQueueTest.java 2009/11/21 09:28:16 1.17 +++ jsr166/src/test/tck/LinkedBlockingQueueTest.java 2009/11/21 19:11:53 1.19 @@ -48,7 +48,7 @@ public class LinkedBlockingQueueTest ext } /** - * Constructor throws IAE if capacity argument nonpositive + * Constructor throws IAE if capacity argument nonpositive */ public void testConstructor2() { try { @@ -439,14 +439,17 @@ public class LinkedBlockingQueueTest ext * returning timeout status */ public void testInterruptedTimedPoll() throws InterruptedException { - Thread t = new ThreadShouldThrow(InterruptedException.class) { + Thread t = new Thread(new CheckedRunnable() { public void realRun() throws InterruptedException { LinkedBlockingQueue q = populatedQueue(SIZE); for (int i = 0; i < SIZE; ++i) { - threadAssertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, MILLISECONDS)).intValue()); + assertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, MILLISECONDS)).intValue()); } - q.poll(SMALL_DELAY_MS, MILLISECONDS); - }}; + try { + q.poll(SMALL_DELAY_MS, MILLISECONDS); + shouldThrow(); + } catch (InterruptedException success) {} + }}); t.start(); Thread.sleep(SHORT_DELAY_MS);