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

Comparing jsr166/src/test/tck/LinkedTransferQueueTest.java (file contents):
Revision 1.17 by jsr166, Sat Nov 21 19:45:16 2009 UTC vs.
Revision 1.18 by jsr166, Sat Nov 21 21:00:34 2009 UTC

# Line 369 | Line 369 | public class LinkedTransferQueueTest ext
369       */
370      public void testTimedPollWithOffer() throws InterruptedException {
371          final LinkedTransferQueue q = new LinkedTransferQueue();
372 <        Thread t = newStartedThread(new CheckedInterruptedRunnable() {
372 >        Thread t = new Thread(new CheckedRunnable() {
373              void realRun() throws InterruptedException {
374 <                threadAssertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
375 <                q.poll(LONG_DELAY_MS, MILLISECONDS);
376 <                q.poll(LONG_DELAY_MS, MILLISECONDS);
374 >                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
375 >                assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
376 >                try {
377 >                    q.poll(LONG_DELAY_MS, MILLISECONDS);
378 >                    shouldThrow();
379 >                } catch (InterruptedException success) {}
380              }});
381 +
382          Thread.sleep(SMALL_DELAY_MS);
383          assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS));
384          t.interrupt();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines