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.10 by dl, Sun Oct 31 14:55:14 2004 UTC vs.
Revision 1.11 by dl, Thu Jan 20 00:39:13 2005 UTC

# Line 614 | Line 614 | public class LinkedBlockingQueueTest ext
614          }
615          assertTrue(q.isEmpty());
616      }
617 +
618 +    /**
619 +     * An add following remove(x) succeeds
620 +     */
621 +    public void testRemoveElementAndAdd() {
622 +        try {
623 +            LinkedBlockingQueue q = new LinkedBlockingQueue();
624 +            assertTrue(q.add(new Integer(1)));
625 +            assertTrue(q.add(new Integer(2)));
626 +            assertTrue(q.remove(new Integer(1)));
627 +            assertTrue(q.remove(new Integer(2)));
628 +            assertTrue(q.add(new Integer(3)));
629 +            assertTrue(q.take() != null);
630 +        } catch (Exception e){
631 +            unexpectedException();
632 +        }
633 +    }
634          
635      /**
636       * contains(x) reports true when elements added but not yet removed

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines