[cvs] / jsr166 / src / test / tck / ArrayBlockingQueueTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/ArrayBlockingQueueTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.78, Sun Nov 6 03:49:39 2016 UTC revision 1.79, Sun Nov 6 03:52:59 2016 UTC
# Line 565  Line 565 
565       * contains(x) reports true when elements added but not yet removed       * contains(x) reports true when elements added but not yet removed
566       */       */
567      public void testContains() {      public void testContains() {
568          ArrayBlockingQueue q = populatedQueue(SIZE);          int size = ThreadLocalRandom.current().nextInt(1, SIZE);
569          for (int i = 0; i < SIZE; ++i) {          ArrayBlockingQueue q = populatedQueue(size, size, 2 * size, false);
570            assertFalse(q.contains(null));
571            for (int i = 0; i < size; ++i) {
572              assertTrue(q.contains(new Integer(i)));              assertTrue(q.contains(new Integer(i)));
573              assertEquals(i, q.poll());              assertEquals(i, q.poll());
574              assertFalse(q.contains(new Integer(i)));              assertFalse(q.contains(new Integer(i)));

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8