ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/DelayQueueTest.java
(Generate patch)

Comparing jsr166/src/test/tck/DelayQueueTest.java (file contents):
Revision 1.50 by jsr166, Fri May 27 20:07:24 2011 UTC vs.
Revision 1.51 by jsr166, Sat May 28 12:45:38 2011 UTC

# Line 462 | Line 462 | public class DelayQueueTest extends JSR1
462      public void testTimedPoll() throws InterruptedException {
463          DelayQueue q = populatedQueue(SIZE);
464          for (int i = 0; i < SIZE; ++i) {
465 <            assertEquals(new PDelay(i), ((PDelay)q.poll(SHORT_DELAY_MS, MILLISECONDS)));
465 >            long startTime = System.nanoTime();
466 >            assertEquals(new PDelay(i), ((PDelay)q.poll(LONG_DELAY_MS, MILLISECONDS)));
467 >            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
468          }
469 <        assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
469 >        long startTime = System.nanoTime();
470 >        assertNull(q.poll(timeoutMillis(), MILLISECONDS));
471 >        assertTrue(millisElapsedSince(startTime) >= timeoutMillis());
472 >        checkEmpty(q);
473      }
474  
475      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines