343 |
|
q.put(null); |
344 |
|
shouldThrow(); |
345 |
|
} |
346 |
< |
catch (NullPointerException success){ |
346 |
> |
catch (NullPointerException success) { |
347 |
|
} |
348 |
|
} |
349 |
|
|
392 |
|
q.take(); |
393 |
|
t.interrupt(); |
394 |
|
t.join(); |
395 |
< |
} catch (Exception e){ |
395 |
> |
} catch (Exception e) { |
396 |
|
unexpectedException(); |
397 |
|
} |
398 |
|
} |
418 |
|
Thread.sleep(SMALL_DELAY_MS); |
419 |
|
t.interrupt(); |
420 |
|
t.join(); |
421 |
< |
} catch (Exception e){ |
421 |
> |
} catch (Exception e) { |
422 |
|
unexpectedException(); |
423 |
|
} |
424 |
|
} |
432 |
|
for (int i = 0; i < SIZE; ++i) { |
433 |
|
assertEquals(new PDelay(i), ((PDelay)q.take())); |
434 |
|
} |
435 |
< |
} catch (InterruptedException e){ |
435 |
> |
} catch (InterruptedException e) { |
436 |
|
unexpectedException(); |
437 |
|
} |
438 |
|
} |
447 |
|
try { |
448 |
|
q.take(); |
449 |
|
threadShouldThrow(); |
450 |
< |
} catch (InterruptedException success){ } |
450 |
> |
} catch (InterruptedException success) { } |
451 |
|
} |
452 |
|
}); |
453 |
|
try { |
455 |
|
Thread.sleep(SHORT_DELAY_MS); |
456 |
|
t.interrupt(); |
457 |
|
t.join(); |
458 |
< |
} catch (Exception e){ |
458 |
> |
} catch (Exception e) { |
459 |
|
unexpectedException(); |
460 |
|
} |
461 |
|
} |
473 |
|
} |
474 |
|
q.take(); |
475 |
|
threadShouldThrow(); |
476 |
< |
} catch (InterruptedException success){ |
476 |
> |
} catch (InterruptedException success) { |
477 |
|
} |
478 |
|
}}); |
479 |
|
t.start(); |
509 |
|
assertEquals(new PDelay(i), ((PDelay)q.poll(0, TimeUnit.MILLISECONDS))); |
510 |
|
} |
511 |
|
assertNull(q.poll(0, TimeUnit.MILLISECONDS)); |
512 |
< |
} catch (InterruptedException e){ |
512 |
> |
} catch (InterruptedException e) { |
513 |
|
unexpectedException(); |
514 |
|
} |
515 |
|
} |
524 |
|
assertEquals(new PDelay(i), ((PDelay)q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS))); |
525 |
|
} |
526 |
|
assertNull(q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
527 |
< |
} catch (InterruptedException e){ |
527 |
> |
} catch (InterruptedException e) { |
528 |
|
unexpectedException(); |
529 |
|
} |
530 |
|
} |
542 |
|
threadAssertEquals(new PDelay(i), ((PDelay)q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS))); |
543 |
|
} |
544 |
|
threadAssertNull(q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
545 |
< |
} catch (InterruptedException success){ |
545 |
> |
} catch (InterruptedException success) { |
546 |
|
} |
547 |
|
}}); |
548 |
|
t.start(); |
578 |
|
assertTrue(q.offer(new PDelay(0), SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
579 |
|
t.interrupt(); |
580 |
|
t.join(); |
581 |
< |
} catch (Exception e){ |
581 |
> |
} catch (Exception e) { |
582 |
|
unexpectedException(); |
583 |
|
} |
584 |
|
} |
627 |
|
try { |
628 |
|
q.remove(); |
629 |
|
shouldThrow(); |
630 |
< |
} catch (NoSuchElementException success){ |
630 |
> |
} catch (NoSuchElementException success) { |
631 |
|
} |
632 |
|
} |
633 |
|
|
734 |
|
try { |
735 |
|
for (int i = 0; i < o.length; i++) |
736 |
|
assertEquals(o[i], q.take()); |
737 |
< |
} catch (InterruptedException e){ |
737 |
> |
} catch (InterruptedException e) { |
738 |
|
unexpectedException(); |
739 |
|
} |
740 |
|
} |
750 |
|
try { |
751 |
|
for (int i = 0; i < ints.length; i++) |
752 |
|
assertEquals(ints[i], q.take()); |
753 |
< |
} catch (InterruptedException e){ |
753 |
> |
} catch (InterruptedException e) { |
754 |
|
unexpectedException(); |
755 |
|
} |
756 |
|
} |
764 |
|
DelayQueue q = populatedQueue(SIZE); |
765 |
|
Object o[] = q.toArray(null); |
766 |
|
shouldThrow(); |
767 |
< |
} catch (NullPointerException success){} |
767 |
> |
} catch (NullPointerException success) {} |
768 |
|
} |
769 |
|
|
770 |
|
/** |
775 |
|
DelayQueue q = populatedQueue(SIZE); |
776 |
|
Object o[] = q.toArray(new String[10] ); |
777 |
|
shouldThrow(); |
778 |
< |
} catch (ArrayStoreException success){} |
778 |
> |
} catch (ArrayStoreException success) {} |
779 |
|
} |
780 |
|
|
781 |
|
/** |
986 |
|
assertTrue(l.size() >= SIZE); |
987 |
|
t.join(); |
988 |
|
assertTrue(q.size() + l.size() >= SIZE); |
989 |
< |
} catch (Exception e){ |
989 |
> |
} catch (Exception e) { |
990 |
|
unexpectedException(); |
991 |
|
} |
992 |
|
} |