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.20 by jsr166, Sun Nov 22 18:57:17 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();
# Line 564 | Line 570 | public class LinkedTransferQueueTest ext
570       * toArray(null) throws NullPointerException
571       */
572      public void testToArray_BadArg() {
573 +        LinkedTransferQueue q = populatedQueue(SIZE);
574          try {
568            LinkedTransferQueue q = populatedQueue(SIZE);
575              Object o[] = q.toArray(null);
576              shouldThrow();
577          } catch (NullPointerException success) {}
# Line 575 | Line 581 | public class LinkedTransferQueueTest ext
581       * toArray(incompatible array type) throws CCE
582       */
583      public void testToArray1_BadArg() {
584 +        LinkedTransferQueue q = populatedQueue(SIZE);
585          try {
579            LinkedTransferQueue q = populatedQueue(SIZE);
586              Object o[] = q.toArray(new String[10]);
587              shouldThrow();
588          } catch (ArrayStoreException success) {}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines