--- jsr166/src/test/tck/ScheduledExecutorTest.java 2011/05/07 19:34:51 1.40 +++ jsr166/src/test/tck/ScheduledExecutorTest.java 2011/05/27 16:26:29 1.42 @@ -459,7 +459,7 @@ public class ScheduledExecutorTest exten } /** - * isShutDown is false before shutdown, true after + * isShutdown is false before shutdown, true after */ public void testIsShutdown() { @@ -617,7 +617,7 @@ public class ScheduledExecutorTest exten } /** - * shutDownNow returns a list containing tasks that were not run + * shutdownNow returns a list containing tasks that were not run */ public void testShutdownNow() { ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); @@ -639,7 +639,7 @@ public class ScheduledExecutorTest exten * In default setting, shutdown cancels periodic but not delayed * tasks at shutdown */ - public void testShutDown1() throws InterruptedException { + public void testShutdown1() throws InterruptedException { ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); @@ -669,7 +669,7 @@ public class ScheduledExecutorTest exten * If setExecuteExistingDelayedTasksAfterShutdownPolicy is false, * delayed tasks are cancelled at shutdown */ - public void testShutDown2() throws InterruptedException { + public void testShutdown2() throws InterruptedException { ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); p.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); assertFalse(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); @@ -695,30 +695,30 @@ public class ScheduledExecutorTest exten * If setContinueExistingPeriodicTasksAfterShutdownPolicy is set false, * periodic tasks are cancelled at shutdown */ - public void testShutDown3() throws InterruptedException { + public void testShutdown3() throws InterruptedException { ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); p.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); assertTrue(p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); assertFalse(p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); + long initialDelay = LONG_DELAY_MS; ScheduledFuture task = - p.scheduleAtFixedRate(new NoOpRunnable(), 5, 5, MILLISECONDS); + p.scheduleAtFixedRate(new NoOpRunnable(), initialDelay, + 5, MILLISECONDS); try { p.shutdown(); } catch (SecurityException ok) { return; } assertTrue(p.isShutdown()); - BlockingQueue q = p.getQueue(); assertTrue(p.getQueue().isEmpty()); assertTrue(task.isDone()); assertTrue(task.isCancelled()); - assertTrue(p.awaitTermination(SMALL_DELAY_MS, MILLISECONDS)); - assertTrue(p.isTerminated()); + joinPool(p); } /** * if setContinueExistingPeriodicTasksAfterShutdownPolicy is true, * periodic tasks are not cancelled at shutdown */ - public void testShutDown4() throws InterruptedException { + public void testShutdown4() throws InterruptedException { ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1); final CountDownLatch counter = new CountDownLatch(2); try {