459 |
|
} |
460 |
|
|
461 |
|
/** |
462 |
< |
* isShutDown is false before shutdown, true after |
462 |
> |
* isShutdown is false before shutdown, true after |
463 |
|
*/ |
464 |
|
public void testIsShutdown() { |
465 |
|
|
617 |
|
} |
618 |
|
|
619 |
|
/** |
620 |
< |
* shutDownNow returns a list containing tasks that were not run |
620 |
> |
* shutdownNow returns a list containing tasks that were not run |
621 |
|
*/ |
622 |
|
public void testShutdownNow() { |
623 |
|
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
639 |
|
* In default setting, shutdown cancels periodic but not delayed |
640 |
|
* tasks at shutdown |
641 |
|
*/ |
642 |
< |
public void testShutDown1() throws InterruptedException { |
642 |
> |
public void testShutdown1() throws InterruptedException { |
643 |
|
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
644 |
|
assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); |
645 |
|
assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); |
669 |
|
* If setExecuteExistingDelayedTasksAfterShutdownPolicy is false, |
670 |
|
* delayed tasks are cancelled at shutdown |
671 |
|
*/ |
672 |
< |
public void testShutDown2() throws InterruptedException { |
672 |
> |
public void testShutdown2() throws InterruptedException { |
673 |
|
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
674 |
|
p.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); |
675 |
|
assertFalse(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); |
695 |
|
* If setContinueExistingPeriodicTasksAfterShutdownPolicy is set false, |
696 |
|
* periodic tasks are cancelled at shutdown |
697 |
|
*/ |
698 |
< |
public void testShutDown3() throws InterruptedException { |
698 |
> |
public void testShutdown3() throws InterruptedException { |
699 |
|
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
700 |
|
assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); |
701 |
|
assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); |
718 |
|
* if setContinueExistingPeriodicTasksAfterShutdownPolicy is true, |
719 |
|
* periodic tasks are not cancelled at shutdown |
720 |
|
*/ |
721 |
< |
public void testShutDown4() throws InterruptedException { |
721 |
> |
public void testShutdown4() throws InterruptedException { |
722 |
|
ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); |
723 |
|
final CountDownLatch counter = new CountDownLatch(2); |
724 |
|
try { |