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

Comparing jsr166/src/test/tck/ArrayBlockingQueueTest.java (file contents):
Revision 1.63 by jsr166, Sat Feb 28 18:23:30 2015 UTC vs.
Revision 1.64 by jsr166, Sat Feb 28 19:59:23 2015 UTC

# Line 159 | Line 159 | public class ArrayBlockingQueueTest exte
159       * remainingCapacity decreases on add, increases on remove
160       */
161      public void testRemainingCapacity() {
162 <        ArrayBlockingQueue q = populatedQueue(SIZE);
162 >        BlockingQueue q = populatedQueue(SIZE);
163          for (int i = 0; i < SIZE; ++i) {
164              assertEquals(i, q.remainingCapacity());
165 <            assertEquals(SIZE-i, q.size());
166 <            q.remove();
165 >            assertEquals(SIZE, q.size() + q.remainingCapacity());
166 >            assertEquals(i, q.remove());
167          }
168          for (int i = 0; i < SIZE; ++i) {
169              assertEquals(SIZE-i, q.remainingCapacity());
170 <            assertEquals(i, q.size());
171 <            q.add(new Integer(i));
170 >            assertEquals(SIZE, q.size() + q.remainingCapacity());
171 >            assertTrue(q.add(i));
172          }
173      }
174  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines