705 |
|
} |
706 |
|
|
707 |
|
/** |
708 |
< |
* shutdownNow returns a list containing tasks that were not run |
708 |
> |
* shutdownNow returns a list containing tasks that were not run, |
709 |
> |
* and those tasks are drained from the queue |
710 |
|
*/ |
711 |
|
public void testShutdownNow() { |
712 |
|
CustomExecutor p = new CustomExecutor(1); |
716 |
|
try { |
717 |
|
List<Runnable> l = p.shutdownNow(); |
718 |
|
assertTrue(p.isShutdown()); |
719 |
+ |
assertTrue(p.getQueue().isEmpty()); |
720 |
|
assertEquals(5, l.size()); |
721 |
|
} catch (SecurityException ok) { |
722 |
|
// Allowed in case test doesn't have privs |