[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.80, Sun Nov 6 04:16:52 2016 UTC revision 1.81, Sun Nov 6 06:27:04 2016 UTC
# Line 579  Line 579 
579       * clear removes all elements       * clear removes all elements
580       */       */
581      public void testClear() {      public void testClear() {
582          ArrayBlockingQueue q = populatedQueue(SIZE);          int size = ThreadLocalRandom.current().nextInt(1, 5);
583            ArrayBlockingQueue q = populatedQueue(size, size, 2 * size, false);
584            int capacity = size + q.remainingCapacity();
585          q.clear();          q.clear();
586          assertTrue(q.isEmpty());          assertTrue(q.isEmpty());
587          assertEquals(0, q.size());          assertEquals(0, q.size());
588          assertEquals(SIZE, q.remainingCapacity());          assertEquals(capacity, q.remainingCapacity());
589          q.add(one);          q.add(one);
590          assertFalse(q.isEmpty());          assertFalse(q.isEmpty());
591          assertTrue(q.contains(one));          assertTrue(q.contains(one));

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8