284 |
|
shouldThrow(); |
285 |
|
} catch (NullPointerException success) {} |
286 |
|
} |
287 |
+ |
|
288 |
|
/** |
289 |
|
* addAll of a collection with any null elements throws NPE after |
290 |
|
* possibly adding some elements |
492 |
|
final PDelay pdelay = new PDelay(0); |
493 |
|
Thread t = new Thread(new CheckedRunnable() { |
494 |
|
public void realRun() throws InterruptedException { |
494 |
– |
assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); |
495 |
– |
assertSame(pdelay, q.poll(LONG_DELAY_MS, MILLISECONDS)); |
495 |
|
try { |
496 |
+ |
assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); |
497 |
+ |
assertSame(pdelay, q.poll(LONG_DELAY_MS, MILLISECONDS)); |
498 |
|
q.poll(LONG_DELAY_MS, MILLISECONDS); |
499 |
|
shouldThrow(); |
500 |
|
} catch (InterruptedException success) {} |
788 |
|
public void testPeekDelayed() { |
789 |
|
DelayQueue q = new DelayQueue(); |
790 |
|
q.add(new NanoDelay(Long.MAX_VALUE)); |
791 |
< |
assert(q.peek() != null); |
791 |
> |
assertNotNull(q.peek()); |
792 |
|
} |
793 |
|
|
794 |
|
|