651 |
|
} |
652 |
|
|
653 |
|
/** |
654 |
< |
* shutdownNow returns a list containing tasks that were not run |
654 |
> |
* shutdownNow returns a list containing tasks that were not run, |
655 |
> |
* and those tasks are drained from the queue |
656 |
|
*/ |
657 |
|
public void testShutdownNow() { |
658 |
|
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
662 |
|
try { |
663 |
|
List<Runnable> l = p.shutdownNow(); |
664 |
|
assertTrue(p.isShutdown()); |
665 |
+ |
assertTrue(p.getQueue().isEmpty()); |
666 |
|
assertEquals(5, l.size()); |
667 |
|
} catch (SecurityException ok) { |
668 |
|
// Allowed in case test doesn't have privs |