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.41 by jsr166, Tue May 31 16:16:24 2011 UTC vs.
Revision 1.43 by jsr166, Tue Oct 25 20:29:12 2011 UTC

# Line 29 | Line 29 | public class LinkedBlockingDequeTest ext
29  
30      public static class Bounded extends BlockingQueueTest {
31          protected BlockingQueue emptyCollection() {
32 <            return new LinkedBlockingDeque(20);
32 >            return new LinkedBlockingDeque(SIZE);
33          }
34      }
35  
# Line 1400 | Line 1400 | public class LinkedBlockingDequeTest ext
1400      }
1401  
1402      /**
1403     * remove(x) removes x and returns true if present
1404     */
1405    public void testRemoveElement() {
1406        LinkedBlockingDeque q = populatedDeque(SIZE);
1407        for (int i = 1; i < SIZE; i+=2) {
1408            assertTrue(q.contains(i));
1409            assertTrue(q.remove(i));
1410            assertFalse(q.contains(i));
1411            assertTrue(q.contains(i-1));
1412        }
1413        for (int i = 0; i < SIZE; i+=2) {
1414            assertTrue(q.contains(i));
1415            assertTrue(q.remove(i));
1416            assertFalse(q.contains(i));
1417            assertFalse(q.remove(i+1));
1418            assertFalse(q.contains(i+1));
1419        }
1420        assertTrue(q.isEmpty());
1421    }
1422
1423    /**
1403       * contains(x) reports true when elements added but not yet removed
1404       */
1405      public void testContains() {
# Line 1500 | Line 1479 | public class LinkedBlockingDequeTest ext
1479      /**
1480       * toArray contains all elements in FIFO order
1481       */
1482 <    public void testToArray() throws InterruptedException{
1482 >    public void testToArray() throws InterruptedException {
1483          LinkedBlockingDeque q = populatedDeque(SIZE);
1484          Object[] o = q.toArray();
1485          for (int i = 0; i < o.length; i++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines