148 |
|
*/ |
149 |
|
public void testConstructor3() { |
150 |
|
try { |
151 |
< |
DelayQueue q = new DelayQueue(null); |
151 |
> |
new DelayQueue(null); |
152 |
|
shouldThrow(); |
153 |
|
} catch (NullPointerException success) {} |
154 |
|
} |
159 |
|
public void testConstructor4() { |
160 |
|
try { |
161 |
|
PDelay[] ints = new PDelay[SIZE]; |
162 |
< |
DelayQueue q = new DelayQueue(Arrays.asList(ints)); |
162 |
> |
new DelayQueue(Arrays.asList(ints)); |
163 |
|
shouldThrow(); |
164 |
|
} catch (NullPointerException success) {} |
165 |
|
} |
172 |
|
PDelay[] ints = new PDelay[SIZE]; |
173 |
|
for (int i = 0; i < SIZE-1; ++i) |
174 |
|
ints[i] = new PDelay(i); |
175 |
< |
DelayQueue q = new DelayQueue(Arrays.asList(ints)); |
175 |
> |
new DelayQueue(Arrays.asList(ints)); |
176 |
|
shouldThrow(); |
177 |
|
} catch (NullPointerException success) {} |
178 |
|
} |
614 |
|
++i; |
615 |
|
} |
616 |
|
assertEquals(i, SIZE); |
617 |
+ |
assertIteratorExhausted(it); |
618 |
+ |
} |
619 |
+ |
|
620 |
+ |
/** |
621 |
+ |
* iterator of empty collection has no elements |
622 |
+ |
*/ |
623 |
+ |
public void testEmptyIterator() { |
624 |
+ |
assertIteratorExhausted(new DelayQueue().iterator()); |
625 |
|
} |
626 |
|
|
627 |
|
/** |