--- jsr166/src/test/tck/ScheduledExecutorSubclassTest.java 2010/11/17 23:12:31 1.17 +++ jsr166/src/test/tck/ScheduledExecutorSubclassTest.java 2011/04/14 22:55:08 1.20 @@ -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/ */ import junit.framework.*; @@ -291,17 +291,17 @@ public class ScheduledExecutorSubclassTe /** * schedule callable throws RejectedExecutionException if shutdown */ - public void testSchedule3_RejectedExecutionException() { - CustomExecutor se = new CustomExecutor(1); - try { - se.shutdown(); - se.schedule(new NoOpCallable(), - MEDIUM_DELAY_MS, MILLISECONDS); - shouldThrow(); - } catch (RejectedExecutionException success) { - } catch (SecurityException ok) { - } - joinPool(se); + public void testSchedule3_RejectedExecutionException() { + CustomExecutor se = new CustomExecutor(1); + try { + se.shutdown(); + se.schedule(new NoOpCallable(), + MEDIUM_DELAY_MS, MILLISECONDS); + shouldThrow(); + } catch (RejectedExecutionException success) { + } catch (SecurityException ok) { + } + joinPool(se); } /** @@ -535,11 +535,12 @@ public class ScheduledExecutorSubclassTe 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; }