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

Comparing jsr166/src/test/tck/LinkedBlockingDequeTest.java (file contents):
Revision 1.26 by jsr166, Tue Oct 19 00:41:14 2010 UTC vs.
Revision 1.30 by jsr166, Wed Nov 3 16:46:34 2010 UTC

# Line 682 | Line 682 | public class LinkedBlockingDequeTest ext
682      }
683  
684      /**
685     * take blocks interruptibly when empty
686     */
687    public void testTakeFromEmpty() throws InterruptedException {
688        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
689        Thread t = new ThreadShouldThrow(InterruptedException.class) {
690            public void realRun() throws InterruptedException {
691                q.take();
692            }};
693
694        t.start();
695        Thread.sleep(SHORT_DELAY_MS);
696        t.interrupt();
697        t.join();
698    }
699
700    /**
685       * Take removes existing elements until empty, then blocks interruptibly
686       */
687      public void testBlockingTake() throws InterruptedException {
# Line 1331 | Line 1315 | public class LinkedBlockingDequeTest ext
1315      }
1316  
1317      /**
1318 <     * toArray(null) throws NPE
1318 >     * toArray(null) throws NullPointerException
1319       */
1320 <    public void testToArray_BadArg() {
1320 >    public void testToArray_NullArg() {
1321          LinkedBlockingDeque q = populatedDeque(SIZE);
1322          try {
1323 <            Object o[] = q.toArray(null);
1323 >            q.toArray(null);
1324              shouldThrow();
1325          } catch (NullPointerException success) {}
1326      }
1327  
1328      /**
1329 <     * toArray with incompatible array type throws CCE
1329 >     * toArray(incompatible array type) throws ArrayStoreException
1330       */
1331      public void testToArray1_BadArg() {
1332          LinkedBlockingDeque q = populatedDeque(SIZE);
1333          try {
1334 <            Object o[] = q.toArray(new String[10]);
1334 >            q.toArray(new String[10]);
1335              shouldThrow();
1336          } catch (ArrayStoreException success) {}
1337      }
# Line 1654 | Line 1638 | public class LinkedBlockingDequeTest ext
1638                  assertTrue(q.offer(new Integer(j)));
1639              ArrayList l = new ArrayList();
1640              q.drainTo(l, i);
1641 <            int k = (i < SIZE)? i : SIZE;
1641 >            int k = (i < SIZE) ? i : SIZE;
1642              assertEquals(l.size(), k);
1643              assertEquals(q.size(), SIZE-k);
1644              for (int j = 0; j < k; ++j)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines