702 |
|
p.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); |
703 |
|
assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); |
704 |
|
assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); |
705 |
+ |
long initialDelay = LONG_DELAY_MS; |
706 |
|
ScheduledFuture task = |
707 |
< |
p.scheduleAtFixedRate(new NoOpRunnable(), 5, 5, MILLISECONDS); |
707 |
> |
p.scheduleAtFixedRate(new NoOpRunnable(), initialDelay, |
708 |
> |
5, MILLISECONDS); |
709 |
|
try { p.shutdown(); } catch (SecurityException ok) { return; } |
710 |
|
assertTrue(p.isShutdown()); |
709 |
– |
BlockingQueue q = p.getQueue(); |
711 |
|
assertTrue(p.getQueue().isEmpty()); |
712 |
|
assertTrue(task.isDone()); |
713 |
|
assertTrue(task.isCancelled()); |
714 |
< |
assertTrue(p.awaitTermination(SMALL_DELAY_MS, MILLISECONDS)); |
714 |
< |
assertTrue(p.isTerminated()); |
714 |
> |
joinPool(p); |
715 |
|
} |
716 |
|
|
717 |
|
/** |