296 |
|
/** |
297 |
|
* put(null) throws NPE |
298 |
|
*/ |
299 |
< |
public void testPutNull() { |
299 |
> |
public void testPutNull() { |
300 |
|
try { |
301 |
|
PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE); |
302 |
|
q.put(null); |
303 |
|
shouldThrow(); |
304 |
|
} catch (NullPointerException success) {} |
305 |
< |
} |
305 |
> |
} |
306 |
|
|
307 |
|
/** |
308 |
|
* all elements successfully put are contained |
309 |
|
*/ |
310 |
< |
public void testPut() { |
311 |
< |
PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE); |
312 |
< |
for (int i = 0; i < SIZE; ++i) { |
313 |
< |
Integer I = new Integer(i); |
314 |
< |
q.put(I); |
315 |
< |
assertTrue(q.contains(I)); |
316 |
< |
} |
317 |
< |
assertEquals(SIZE, q.size()); |
310 |
> |
public void testPut() { |
311 |
> |
PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE); |
312 |
> |
for (int i = 0; i < SIZE; ++i) { |
313 |
> |
Integer I = new Integer(i); |
314 |
> |
q.put(I); |
315 |
> |
assertTrue(q.contains(I)); |
316 |
> |
} |
317 |
> |
assertEquals(SIZE, q.size()); |
318 |
|
} |
319 |
|
|
320 |
|
/** |