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.57 by jsr166, Sat Apr 25 04:55:31 2015 UTC vs.
Revision 1.58 by jsr166, Fri May 15 18:21:19 2015 UTC

# Line 424 | Line 424 | public class LinkedBlockingDequeTest ext
424       * push(null) throws NPE
425       */
426      public void testPushNull() {
427 +        LinkedBlockingDeque q = new LinkedBlockingDeque(1);
428          try {
428            LinkedBlockingDeque q = new LinkedBlockingDeque(1);
429              q.push(null);
430              shouldThrow();
431          } catch (NullPointerException success) {}
# Line 435 | Line 435 | public class LinkedBlockingDequeTest ext
435       * push succeeds if not full; throws ISE if full
436       */
437      public void testPush() {
438 +        LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
439 +        for (int i = 0; i < SIZE; ++i) {
440 +            Integer x = new Integer(i);
441 +            q.push(x);
442 +            assertEquals(x, q.peek());
443 +        }
444 +        assertEquals(0, q.remainingCapacity());
445          try {
439            LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
440            for (int i = 0; i < SIZE; ++i) {
441                Integer x = new Integer(i);
442                q.push(x);
443                assertEquals(x, q.peek());
444            }
445            assertEquals(0, q.remainingCapacity());
446              q.push(new Integer(SIZE));
447              shouldThrow();
448          } catch (IllegalStateException success) {}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines