--- jsr166/src/test/tck/ScheduledExecutorSubclassTest.java 2009/11/20 22:58:48 1.6 +++ jsr166/src/test/tck/ScheduledExecutorSubclassTest.java 2009/11/21 02:07:27 1.7 @@ -12,10 +12,10 @@ import java.util.concurrent.atomic.*; public class ScheduledExecutorSubclassTest extends JSR166TestCase { public static void main(String[] args) { - junit.textui.TestRunner.run (suite()); + junit.textui.TestRunner.run (suite()); } public static Test suite() { - return new TestSuite(ScheduledExecutorSubclassTest.class); + return new TestSuite(ScheduledExecutorSubclassTest.class); } static class CustomTask implements RunnableScheduledFuture { @@ -196,10 +196,10 @@ public class ScheduledExecutorSubclassTe public void testExecuteNull() throws InterruptedException { CustomExecutor se = new CustomExecutor(1); try { - se.execute(null); + se.execute(null); shouldThrow(); - } catch (NullPointerException success) {} - joinPool(se); + } catch (NullPointerException success) {} + joinPool(se); } /** @@ -207,12 +207,12 @@ public class ScheduledExecutorSubclassTe */ public void testScheduleNull() throws InterruptedException { CustomExecutor se = new CustomExecutor(1); - try { + try { TrackedCallable callable = null; - Future f = se.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); + Future f = se.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); shouldThrow(); - } catch (NullPointerException success) {} - joinPool(se); + } catch (NullPointerException success) {} + joinPool(se); } /** @@ -376,7 +376,7 @@ public class ScheduledExecutorSubclassTe */ public void testGetThreadFactory() { ThreadFactory tf = new SimpleThreadFactory(); - CustomExecutor p = new CustomExecutor(1, tf); + CustomExecutor p = new CustomExecutor(1, tf); assertSame(tf, p.getThreadFactory()); joinPool(p); } @@ -386,7 +386,7 @@ public class ScheduledExecutorSubclassTe */ public void testSetThreadFactory() { ThreadFactory tf = new SimpleThreadFactory(); - CustomExecutor p = new CustomExecutor(1); + CustomExecutor p = new CustomExecutor(1); p.setThreadFactory(tf); assertSame(tf, p.getThreadFactory()); joinPool(p); @@ -396,7 +396,7 @@ public class ScheduledExecutorSubclassTe * setThreadFactory(null) throws NPE */ public void testSetThreadFactoryNull() { - CustomExecutor p = new CustomExecutor(1); + CustomExecutor p = new CustomExecutor(1); try { p.setThreadFactory(null); shouldThrow(); @@ -410,14 +410,14 @@ public class ScheduledExecutorSubclassTe * is isShutDown is false before shutdown, true after */ public void testIsShutdown() { - CustomExecutor p1 = new CustomExecutor(1); + CustomExecutor p1 = new CustomExecutor(1); try { assertFalse(p1.isShutdown()); } finally { try { p1.shutdown(); } catch (SecurityException ok) { return; } } - assertTrue(p1.isShutdown()); + assertTrue(p1.isShutdown()); } @@ -425,7 +425,7 @@ public class ScheduledExecutorSubclassTe * isTerminated is false before termination, true after */ public void testIsTerminated() throws InterruptedException { - CustomExecutor p1 = new CustomExecutor(1); + CustomExecutor p1 = new CustomExecutor(1); try { p1.execute(new SmallRunnable()); } finally { @@ -439,7 +439,7 @@ public class ScheduledExecutorSubclassTe * isTerminating is not true when running or when terminated */ public void testIsTerminating() throws InterruptedException { - CustomExecutor p1 = new CustomExecutor(1); + CustomExecutor p1 = new CustomExecutor(1); assertFalse(p1.isTerminating()); try { p1.execute(new SmallRunnable()); @@ -530,7 +530,7 @@ public class ScheduledExecutorSubclassTe * shutDownNow returns a list containing tasks that were not run */ public void testShutDownNow() { - CustomExecutor p1 = new CustomExecutor(1); + CustomExecutor p1 = new CustomExecutor(1); for (int i = 0; i < 5; i++) p1.schedule(new SmallPossiblyInterruptedRunnable(), SHORT_DELAY_MS, MILLISECONDS); List l; @@ -539,8 +539,8 @@ public class ScheduledExecutorSubclassTe } catch (SecurityException ok) { return; } - assertTrue(p1.isShutdown()); - assertTrue(l.size() > 0 && l.size() <= 5); + assertTrue(p1.isShutdown()); + assertTrue(l.size() > 0 && l.size() <= 5); joinPool(p1); }