--- jsr166/src/test/tck/LinkedBlockingDequeTest.java 2009/11/21 19:11:53 1.13 +++ jsr166/src/test/tck/LinkedBlockingDequeTest.java 2009/11/21 21:00:34 1.14 @@ -746,12 +746,15 @@ public class LinkedBlockingDequeTest ext */ public void testTimedPollWithOffer() throws InterruptedException { final LinkedBlockingDeque q = new LinkedBlockingDeque(2); - Thread t = new ThreadShouldThrow(InterruptedException.class) { + Thread t = new Thread(new CheckedRunnable() { public void realRun() throws InterruptedException { - threadAssertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); - q.poll(LONG_DELAY_MS, MILLISECONDS); - q.poll(LONG_DELAY_MS, MILLISECONDS); - }}; + assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); + assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); + try { + q.poll(LONG_DELAY_MS, MILLISECONDS); + shouldThrow(); + } catch (InterruptedException success) {} + }}); t.start(); Thread.sleep(SMALL_DELAY_MS); @@ -957,12 +960,15 @@ public class LinkedBlockingDequeTest ext */ public void testTimedPollFirstWithOfferFirst() throws InterruptedException { final LinkedBlockingDeque q = new LinkedBlockingDeque(2); - Thread t = new ThreadShouldThrow(InterruptedException.class) { + Thread t = new Thread(new CheckedRunnable() { public void realRun() throws InterruptedException { - threadAssertNull(q.pollFirst(SHORT_DELAY_MS, MILLISECONDS)); - q.pollFirst(LONG_DELAY_MS, MILLISECONDS); - q.pollFirst(LONG_DELAY_MS, MILLISECONDS); - }}; + assertNull(q.pollFirst(SHORT_DELAY_MS, MILLISECONDS)); + assertSame(zero, q.pollFirst(LONG_DELAY_MS, MILLISECONDS)); + try { + q.pollFirst(LONG_DELAY_MS, MILLISECONDS); + shouldThrow(); + } catch (InterruptedException success) {} + }}); t.start(); Thread.sleep(SMALL_DELAY_MS);