38 |
|
} |
39 |
|
|
40 |
|
public static void main(String[] args) { |
41 |
< |
junit.textui.TestRunner.run(suite()); |
41 |
> |
main(suite(), args); |
42 |
|
} |
43 |
|
|
44 |
|
public static Test suite() { |
197 |
|
* Offer of non-Comparable throws CCE |
198 |
|
*/ |
199 |
|
public void testOfferNonComparable() { |
200 |
+ |
PriorityBlockingQueue q = new PriorityBlockingQueue(1); |
201 |
|
try { |
201 |
– |
PriorityBlockingQueue q = new PriorityBlockingQueue(1); |
202 |
– |
q.offer(new Object()); |
202 |
|
q.offer(new Object()); |
203 |
|
q.offer(new Object()); |
204 |
|
shouldThrow(); |
220 |
|
* addAll(this) throws IAE |
221 |
|
*/ |
222 |
|
public void testAddAllSelf() { |
223 |
+ |
PriorityBlockingQueue q = populatedQueue(SIZE); |
224 |
|
try { |
225 |
– |
PriorityBlockingQueue q = populatedQueue(SIZE); |
225 |
|
q.addAll(q); |
226 |
|
shouldThrow(); |
227 |
|
} catch (IllegalArgumentException success) {} |
232 |
|
* possibly adding some elements |
233 |
|
*/ |
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) |
238 |
+ |
ints[i] = new Integer(i); |
239 |
|
try { |
237 |
– |
PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE); |
238 |
– |
Integer[] ints = new Integer[SIZE]; |
239 |
– |
for (int i = 0; i < SIZE-1; ++i) |
240 |
– |
ints[i] = new Integer(i); |
240 |
|
q.addAll(Arrays.asList(ints)); |
241 |
|
shouldThrow(); |
242 |
|
} catch (NullPointerException success) {} |