--- jsr166/src/test/tck/DelayQueueTest.java 2009/11/21 10:29:50 1.21 +++ jsr166/src/test/tck/DelayQueueTest.java 2009/11/21 22:00:46 1.24 @@ -375,8 +375,8 @@ public class DelayQueueTest extends JSR1 public void realRun() throws InterruptedException { q.put(new PDelay(0)); q.put(new PDelay(0)); - threadAssertTrue(q.offer(new PDelay(0), SHORT_DELAY_MS, MILLISECONDS)); - threadAssertTrue(q.offer(new PDelay(0), LONG_DELAY_MS, MILLISECONDS)); + assertTrue(q.offer(new PDelay(0), SHORT_DELAY_MS, MILLISECONDS)); + assertTrue(q.offer(new PDelay(0), LONG_DELAY_MS, MILLISECONDS)); }}); t.start(); @@ -476,7 +476,7 @@ public class DelayQueueTest extends JSR1 assertEquals(new PDelay(i), ((PDelay)q.poll(SHORT_DELAY_MS, MILLISECONDS))); } try { - q.poll(LONG_DELAY_MS, MILLISECONDS); + q.poll(SMALL_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (InterruptedException success) {} }}); @@ -493,10 +493,11 @@ public class DelayQueueTest extends JSR1 */ public void testTimedPollWithOffer() throws InterruptedException { final DelayQueue q = new DelayQueue(); + final PDelay pdelay = new PDelay(0); Thread t = new Thread(new CheckedRunnable() { public void realRun() throws InterruptedException { assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); - q.poll(LONG_DELAY_MS, MILLISECONDS); + assertSame(pdelay, q.poll(LONG_DELAY_MS, MILLISECONDS)); try { q.poll(LONG_DELAY_MS, MILLISECONDS); shouldThrow(); @@ -505,7 +506,7 @@ public class DelayQueueTest extends JSR1 t.start(); Thread.sleep(SMALL_DELAY_MS); - assertTrue(q.offer(new PDelay(0), SHORT_DELAY_MS, MILLISECONDS)); + assertTrue(q.offer(pdelay, SHORT_DELAY_MS, MILLISECONDS)); t.interrupt(); t.join(); }