--- jsr166/src/test/tck/JSR166TestCase.java 2009/11/20 00:58:01 1.40 +++ jsr166/src/test/tck/JSR166TestCase.java 2009/11/21 17:38:05 1.44 @@ -90,13 +90,13 @@ public class JSR166TestCase extends Test /** * Runs all JSR166 unit tests using junit.textui.TestRunner */ - public static void main (String[] args) { + public static void main(String[] args) { int iters = 1; if (args.length > 0) iters = Integer.parseInt(args[0]); Test s = suite(); for (int i = 0; i < iters; ++i) { - junit.textui.TestRunner.run (s); + junit.textui.TestRunner.run(s); System.gc(); System.runFinalization(); } @@ -106,7 +106,7 @@ public class JSR166TestCase extends Test /** * Collects all JSR166 unit tests as one suite */ - public static Test suite ( ) { + public static Test suite() { TestSuite suite = new TestSuite("JSR166 Unit Tests"); suite.addTest(new TestSuite(ForkJoinPoolTest.class)); @@ -195,7 +195,7 @@ public class JSR166TestCase extends Test /** * Sets delays as multiples of SHORT_DELAY. */ - protected void setDelays() { + protected void setDelays() { SHORT_DELAY_MS = getShortDelay(); SMALL_DELAY_MS = SHORT_DELAY_MS * 5; MEDIUM_DELAY_MS = SHORT_DELAY_MS * 10; @@ -328,7 +328,7 @@ public class JSR166TestCase extends Test } catch (SecurityException ok) { // Allowed in case test doesn't have privs } catch (InterruptedException ie) { - fail("Unexpected exception"); + fail("Unexpected InterruptedException"); } } @@ -398,16 +398,16 @@ public class JSR166TestCase extends Test AdjustablePolicy() { } void addPermission(Permission perm) { perms.add(perm); } void clearPermissions() { perms = new Permissions(); } - public PermissionCollection getPermissions(CodeSource cs) { - return perms; - } - public PermissionCollection getPermissions(ProtectionDomain pd) { - return perms; - } - public boolean implies(ProtectionDomain pd, Permission p) { - return perms.implies(p); - } - public void refresh() {} + public PermissionCollection getPermissions(CodeSource cs) { + return perms; + } + public PermissionCollection getPermissions(ProtectionDomain pd) { + return perms; + } + public boolean implies(ProtectionDomain pd, Permission p) { + return perms.implies(p); + } + public void refresh() {} } /** @@ -417,8 +417,7 @@ public class JSR166TestCase extends Test void sleepTillInterrupted(long timeoutMillis) { try { Thread.sleep(timeoutMillis); - } catch (InterruptedException wakeup) { - } + } catch (InterruptedException wakeup) {} } /** @@ -573,14 +572,12 @@ public class JSR166TestCase extends Test void realRun() { try { Thread.sleep(SMALL_DELAY_MS); - } - catch (InterruptedException ok) { - } + } catch (InterruptedException ok) {} } } class SmallCallable extends CheckedCallable { - Object realCall() throws Throwable { + Object realCall() throws InterruptedException { Thread.sleep(SMALL_DELAY_MS); return Boolean.TRUE; } @@ -608,9 +605,7 @@ public class JSR166TestCase extends Test void realRun() { try { Thread.sleep(MEDIUM_DELAY_MS); - } - catch (InterruptedException ok) { - } + } catch (InterruptedException ok) {} } } @@ -618,9 +613,7 @@ public class JSR166TestCase extends Test void realRun() { try { Thread.sleep(LONG_DELAY_MS); - } - catch (InterruptedException ok) { - } + } catch (InterruptedException ok) {} } } @@ -639,8 +632,7 @@ public class JSR166TestCase extends Test try { Thread.sleep(SMALL_DELAY_MS); done = true; - } catch (InterruptedException ok) { - } + } catch (InterruptedException ok) {} } } @@ -650,8 +642,7 @@ public class JSR166TestCase extends Test try { Thread.sleep(MEDIUM_DELAY_MS); done = true; - } catch (InterruptedException ok) { - } + } catch (InterruptedException ok) {} } } @@ -661,8 +652,7 @@ public class JSR166TestCase extends Test try { Thread.sleep(LONG_DELAY_MS); done = true; - } catch (InterruptedException ok) { - } + } catch (InterruptedException ok) {} } } @@ -679,8 +669,7 @@ public class JSR166TestCase extends Test try { Thread.sleep(SMALL_DELAY_MS); done = true; - } catch (InterruptedException ok) { - } + } catch (InterruptedException ok) {} return Boolean.TRUE; } }