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

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

# Line 721 | Line 721 | public class ScheduledExecutorSubclassTe
721      public void testShutDown2() throws InterruptedException {
722          CustomExecutor p = new CustomExecutor(1);
723          p.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
724 +        assertFalse(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
725 +        assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
726          ScheduledFuture[] tasks = new ScheduledFuture[5];
727          for (int i = 0; i < tasks.length; i++)
728              tasks[i] = p.schedule(new NoOpRunnable(),
# Line 745 | Line 747 | public class ScheduledExecutorSubclassTe
747       */
748      public void testShutDown3() throws InterruptedException {
749          CustomExecutor p = new CustomExecutor(1);
750 +        assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
751 +        assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
752          p.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
753 +        assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
754 +        assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
755          ScheduledFuture task =
756              p.scheduleAtFixedRate(new NoOpRunnable(), 5, 5, MILLISECONDS);
757          try { p.shutdown(); } catch (SecurityException ok) { return; }
# Line 764 | Line 770 | public class ScheduledExecutorSubclassTe
770       */
771      public void testShutDown4() throws InterruptedException {
772          CustomExecutor p = new CustomExecutor(1);
767        p.setContinueExistingPeriodicTasksAfterShutdownPolicy(true);
773          final CountDownLatch counter = new CountDownLatch(2);
774          try {
775 +            p.setContinueExistingPeriodicTasksAfterShutdownPolicy(true);
776 +            assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy());
777 +            assertTrue(p.getContinueExistingPeriodicTasksAfterShutdownPolicy());
778              final Runnable r = new CheckedRunnable() {
779                  public void realRun() {
780                      counter.countDown();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines