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

Comparing jsr166/src/test/tck/PriorityBlockingQueueTest.java (file contents):
Revision 1.62 by jsr166, Fri May 15 18:21:19 2015 UTC vs.
Revision 1.63 by jsr166, Sat May 23 00:53:08 2015 UTC

# Line 116 | Line 116 | public class PriorityBlockingQueueTest e
116       */
117      public void testConstructor5() {
118          Integer[] ints = new Integer[SIZE];
119 <        for (int i = 0; i < SIZE-1; ++i)
119 >        for (int i = 0; i < SIZE - 1; ++i)
120              ints[i] = i;
121          Collection<Integer> elements = Arrays.asList(ints);
122          try {
# Line 148 | Line 148 | public class PriorityBlockingQueueTest e
148          for (int i = 0; i < SIZE; ++i)
149              ints[i] = new Integer(i);
150          q.addAll(Arrays.asList(ints));
151 <        for (int i = SIZE-1; i >= 0; --i)
151 >        for (int i = SIZE - 1; i >= 0; --i)
152              assertEquals(ints[i], q.poll());
153      }
154  
# Line 234 | Line 234 | public class PriorityBlockingQueueTest e
234      public void testAddAll3() {
235          PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE);
236          Integer[] ints = new Integer[SIZE];
237 <        for (int i = 0; i < SIZE-1; ++i)
237 >        for (int i = 0; i < SIZE - 1; ++i)
238              ints[i] = new Integer(i);
239          try {
240              q.addAll(Arrays.asList(ints));
# Line 248 | Line 248 | public class PriorityBlockingQueueTest e
248      public void testAddAll5() {
249          Integer[] empty = new Integer[0];
250          Integer[] ints = new Integer[SIZE];
251 <        for (int i = SIZE-1; i >= 0; --i)
251 >        for (int i = SIZE - 1; i >= 0; --i)
252              ints[i] = new Integer(i);
253          PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE);
254          assertFalse(q.addAll(Arrays.asList(empty)));
# Line 512 | Line 512 | public class PriorityBlockingQueueTest e
512                  assertTrue(changed);
513  
514              assertTrue(q.containsAll(p));
515 <            assertEquals(SIZE-i, q.size());
515 >            assertEquals(SIZE - i, q.size());
516              p.remove();
517          }
518      }
# Line 525 | Line 525 | public class PriorityBlockingQueueTest e
525              PriorityBlockingQueue q = populatedQueue(SIZE);
526              PriorityBlockingQueue p = populatedQueue(i);
527              assertTrue(q.removeAll(p));
528 <            assertEquals(SIZE-i, q.size());
528 >            assertEquals(SIZE - i, q.size());
529              for (int j = 0; j < i; ++j) {
530                  Integer x = (Integer)(p.remove());
531                  assertFalse(q.contains(x));
# Line 689 | Line 689 | public class PriorityBlockingQueueTest e
689          final PriorityBlockingQueue q = populatedQueue(SIZE);
690          Thread t = new Thread(new CheckedRunnable() {
691              public void realRun() {
692 <                q.put(new Integer(SIZE+1));
692 >                q.put(new Integer(SIZE + 1));
693              }});
694  
695          t.start();
# Line 706 | Line 706 | public class PriorityBlockingQueueTest e
706       * drainTo(c, n) empties first min(n, size) elements of queue into c
707       */
708      public void testDrainToN() {
709 <        PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE*2);
709 >        PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE * 2);
710          for (int i = 0; i < SIZE + 2; ++i) {
711              for (int j = 0; j < SIZE; j++)
712                  assertTrue(q.offer(new Integer(j)));
# Line 714 | Line 714 | public class PriorityBlockingQueueTest e
714              q.drainTo(l, i);
715              int k = (i < SIZE) ? i : SIZE;
716              assertEquals(k, l.size());
717 <            assertEquals(SIZE-k, q.size());
717 >            assertEquals(SIZE - k, q.size());
718              for (int j = 0; j < k; ++j)
719                  assertEquals(l.get(j), new Integer(j));
720              do {} while (q.poll() != null);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines