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.18 by jsr166, Sat Nov 21 21:00:34 2009 UTC vs.
Revision 1.19 by jsr166, Sun Nov 22 00:17:37 2009 UTC

# Line 284 | Line 284 | public class LinkedTransferQueueTest ext
284       */
285      public void testBlockingTake() throws InterruptedException {
286          final LinkedTransferQueue<Integer> q = populatedQueue(SIZE);
287 <        Thread t = newStartedThread(new CheckedInterruptedRunnable() {
288 <            void realRun() throws InterruptedException {
287 >        Thread t = new Thread(new CheckedRunnable() {
288 >            public void realRun() throws InterruptedException {
289                  for (int i = 0; i < SIZE; ++i) {
290 <                    threadAssertEquals(i, (int) q.take());
290 >                    assertEquals(i, (int) q.take());
291                  }
292 <                q.take();
292 >                try {
293 >                    q.take();
294 >                    shouldThrow();
295 >                } catch (InterruptedException success) {}
296              }});
297 <        Thread.sleep(SMALL_DELAY_MS);
297 >
298 >        t.start();
299 >        Thread.sleep(SHORT_DELAY_MS);
300          t.interrupt();
301          t.join();
302          checkEmpty(q);
# Line 379 | Line 384 | public class LinkedTransferQueueTest ext
384                  } catch (InterruptedException success) {}
385              }});
386  
387 +        t.start();
388          Thread.sleep(SMALL_DELAY_MS);
389          assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS));
390          t.interrupt();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines