ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ScheduledExecutorTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ScheduledExecutorTest.java (file contents):
Revision 1.33 by jsr166, Mon Oct 11 07:21:32 2010 UTC vs.
Revision 1.34 by jsr166, Mon Oct 11 15:46:40 2010 UTC

# Line 671 | Line 671 | public class ScheduledExecutorTest exten
671      public void testShutDown2() throws InterruptedException {
672          ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1);
673          p.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
674 +        assertFalse(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
675 +        assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
676          ScheduledFuture[] tasks = new ScheduledFuture[5];
677          for (int i = 0; i < tasks.length; i++)
678              tasks[i] = p.schedule(new NoOpRunnable(),
# Line 694 | Line 696 | public class ScheduledExecutorTest exten
696       */
697      public void testShutDown3() throws InterruptedException {
698          ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1);
699 +        assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
700 +        assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
701          p.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
702 +        assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
703 +        assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
704          ScheduledFuture task =
705              p.scheduleAtFixedRate(new NoOpRunnable(), 5, 5, MILLISECONDS);
706          try { p.shutdown(); } catch (SecurityException ok) { return; }
# Line 713 | Line 719 | public class ScheduledExecutorTest exten
719       */
720      public void testShutDown4() throws InterruptedException {
721          ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1);
716        p.setContinueExistingPeriodicTasksAfterShutdownPolicy(true);
722          final CountDownLatch counter = new CountDownLatch(2);
723          try {
724 +            p.setContinueExistingPeriodicTasksAfterShutdownPolicy(true);
725 +            assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
726 +            assertTrue(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
727              final Runnable r = new CheckedRunnable() {
728                  public void realRun() {
729                      counter.countDown();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines