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

Comparing jsr166/src/test/tck/LinkedBlockingQueueTest.java (file contents):
Revision 1.19 by jsr166, Sat Nov 21 19:11:53 2009 UTC vs.
Revision 1.20 by jsr166, Sat Nov 21 21:00:34 2009 UTC

# Line 463 | Line 463 | public class LinkedBlockingQueueTest ext
463       */
464      public void testTimedPollWithOffer() throws InterruptedException {
465          final LinkedBlockingQueue q = new LinkedBlockingQueue(2);
466 <        Thread t = new ThreadShouldThrow(InterruptedException.class) {
466 >        Thread t = new Thread(new CheckedRunnable() {
467              public void realRun() throws InterruptedException {
468 <                threadAssertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
469 <                q.poll(LONG_DELAY_MS, MILLISECONDS);
470 <                q.poll(LONG_DELAY_MS, MILLISECONDS);
471 <            }};
468 >                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
469 >                assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
470 >                try {
471 >                    q.poll(LONG_DELAY_MS, MILLISECONDS);
472 >                    shouldThrow();
473 >                } catch (InterruptedException success) {}
474 >            }});
475  
476          t.start();
477          Thread.sleep(SMALL_DELAY_MS);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines