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

Comparing jsr166/src/test/tck/DelayQueueTest.java (file contents):
Revision 1.71 by jsr166, Sat Apr 25 04:55:30 2015 UTC vs.
Revision 1.72 by jsr166, Fri May 15 18:21:19 2015 UTC

# Line 156 | Line 156 | public class DelayQueueTest extends JSR1
156       */
157      public void testConstructor4() {
158          try {
159 <            PDelay[] ints = new PDelay[SIZE];
160 <            new DelayQueue(Arrays.asList(ints));
159 >            new DelayQueue(Arrays.asList(new PDelay[SIZE]));
160              shouldThrow();
161          } catch (NullPointerException success) {}
162      }
# Line 166 | Line 165 | public class DelayQueueTest extends JSR1
165       * Initializing from Collection with some null elements throws NPE
166       */
167      public void testConstructor5() {
168 +        PDelay[] a = new PDelay[SIZE];
169 +        for (int i = 0; i < SIZE-1; ++i)
170 +            a[i] = new PDelay(i);
171          try {
172 <            PDelay[] ints = new PDelay[SIZE];
171 <            for (int i = 0; i < SIZE-1; ++i)
172 <                ints[i] = new PDelay(i);
173 <            new DelayQueue(Arrays.asList(ints));
172 >            new DelayQueue(Arrays.asList(a));
173              shouldThrow();
174          } catch (NullPointerException success) {}
175      }
# Line 243 | Line 242 | public class DelayQueueTest extends JSR1
242       * addAll(this) throws IAE
243       */
244      public void testAddAllSelf() {
245 +        DelayQueue q = populatedQueue(SIZE);
246          try {
247            DelayQueue q = populatedQueue(SIZE);
247              q.addAll(q);
248              shouldThrow();
249          } catch (IllegalArgumentException success) {}
# Line 255 | Line 254 | public class DelayQueueTest extends JSR1
254       * possibly adding some elements
255       */
256      public void testAddAll3() {
257 +        DelayQueue q = new DelayQueue();
258 +        PDelay[] a = new PDelay[SIZE];
259 +        for (int i = 0; i < SIZE-1; ++i)
260 +            a[i] = new PDelay(i);
261          try {
262 <            DelayQueue q = new DelayQueue();
260 <            PDelay[] ints = new PDelay[SIZE];
261 <            for (int i = 0; i < SIZE-1; ++i)
262 <                ints[i] = new PDelay(i);
263 <            q.addAll(Arrays.asList(ints));
262 >            q.addAll(Arrays.asList(a));
263              shouldThrow();
264          } catch (NullPointerException success) {}
265      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines