--- jsr166/src/test/tck/ScheduledExecutorTest.java 2010/11/17 23:12:31 1.35 +++ jsr166/src/test/tck/ScheduledExecutorTest.java 2011/04/14 22:55:08 1.38 @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ * Other contributors include Andrew Wright, Jeffrey Hayes, * Pat Fisher, Mike Judd. */ @@ -240,9 +240,9 @@ public class ScheduledExecutorTest exten /** * schedule callable throws RejectedExecutionException if shutdown */ - public void testSchedule3_RejectedExecutionException() throws InterruptedException { - ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1); - try { + public void testSchedule3_RejectedExecutionException() throws InterruptedException { + ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1); + try { se.shutdown(); se.schedule(new NoOpCallable(), MEDIUM_DELAY_MS, MILLISECONDS); @@ -250,7 +250,7 @@ public class ScheduledExecutorTest exten } catch (RejectedExecutionException success) { } catch (SecurityException ok) { } - joinPool(se); + joinPool(se); } /** @@ -485,11 +485,12 @@ public class ScheduledExecutorTest exten try { p.execute(new CheckedRunnable() { public void realRun() throws InterruptedException { - threadStarted.countDown(); assertFalse(p.isTerminated()); + threadStarted.countDown(); done.await(); }}); assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS)); + assertFalse(p.isTerminating()); done.countDown(); } finally { try { p.shutdown(); } catch (SecurityException ok) { return; }