510 |
|
* isShutdown is false before shutdown, true after |
511 |
|
*/ |
512 |
|
public void testIsShutdown() { |
513 |
– |
|
513 |
|
final ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
514 |
< |
try { |
515 |
< |
assertFalse(p.isShutdown()); |
516 |
< |
} |
517 |
< |
finally { |
518 |
< |
try { p.shutdown(); } catch (SecurityException ok) { return; } |
514 |
> |
assertFalse(p.isShutdown()); |
515 |
> |
try (PoolCleaner cleaner = cleaner(p)) { |
516 |
> |
try { |
517 |
> |
p.shutdown(); |
518 |
> |
assertTrue(p.isShutdown()); |
519 |
> |
} catch (SecurityException ok) {} |
520 |
|
} |
521 |
– |
assertTrue(p.isShutdown()); |
521 |
|
} |
522 |
|
|
523 |
|
/** |