510 |
|
} |
511 |
|
|
512 |
|
/** |
513 |
< |
* isShutDown is false before shutdown, true after |
513 |
> |
* isShutdown is false before shutdown, true after |
514 |
|
*/ |
515 |
|
public void testIsShutdown() { |
516 |
|
CustomExecutor p = new CustomExecutor(1); |
667 |
|
} |
668 |
|
|
669 |
|
/** |
670 |
< |
* shutDownNow returns a list containing tasks that were not run |
670 |
> |
* shutdownNow returns a list containing tasks that were not run |
671 |
|
*/ |
672 |
< |
public void testShutDownNow() { |
672 |
> |
public void testShutdownNow() { |
673 |
|
CustomExecutor p = new CustomExecutor(1); |
674 |
|
for (int i = 0; i < 5; i++) |
675 |
|
p.schedule(new SmallPossiblyInterruptedRunnable(), |
689 |
|
* In default setting, shutdown cancels periodic but not delayed |
690 |
|
* tasks at shutdown |
691 |
|
*/ |
692 |
< |
public void testShutDown1() throws InterruptedException { |
692 |
> |
public void testShutdown1() throws InterruptedException { |
693 |
|
CustomExecutor p = new CustomExecutor(1); |
694 |
|
assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); |
695 |
|
assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); |
719 |
|
* If setExecuteExistingDelayedTasksAfterShutdownPolicy is false, |
720 |
|
* delayed tasks are cancelled at shutdown |
721 |
|
*/ |
722 |
< |
public void testShutDown2() throws InterruptedException { |
722 |
> |
public void testShutdown2() throws InterruptedException { |
723 |
|
CustomExecutor p = new CustomExecutor(1); |
724 |
|
p.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); |
725 |
|
assertFalse(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); |
746 |
|
* If setContinueExistingPeriodicTasksAfterShutdownPolicy is set false, |
747 |
|
* periodic tasks are cancelled at shutdown |
748 |
|
*/ |
749 |
< |
public void testShutDown3() throws InterruptedException { |
749 |
> |
public void testShutdown3() throws InterruptedException { |
750 |
|
CustomExecutor p = new CustomExecutor(1); |
751 |
|
assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); |
752 |
|
assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); |
769 |
|
* if setContinueExistingPeriodicTasksAfterShutdownPolicy is true, |
770 |
|
* periodic tasks are not cancelled at shutdown |
771 |
|
*/ |
772 |
< |
public void testShutDown4() throws InterruptedException { |
772 |
> |
public void testShutdown4() throws InterruptedException { |
773 |
|
CustomExecutor p = new CustomExecutor(1); |
774 |
|
final CountDownLatch counter = new CountDownLatch(2); |
775 |
|
try { |