--- jsr166/src/test/tck/ForkJoinTask8Test.java 2014/12/31 16:44:02 1.5 +++ jsr166/src/test/tck/ForkJoinTask8Test.java 2015/02/07 17:43:38 1.9 @@ -3,15 +3,19 @@ * Expert Group and released to the public domain, as explained at * http://creativecommons.org/publicdomain/zero/1.0/ */ + +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; + +import java.util.HashSet; import java.util.concurrent.ExecutionException; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.ForkJoinTask; import java.util.concurrent.RecursiveAction; import java.util.concurrent.TimeoutException; -import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static java.util.concurrent.TimeUnit.SECONDS; -import java.util.HashSet; -import junit.framework.*; + +import junit.framework.Test; +import junit.framework.TestSuite; public class ForkJoinTask8Test extends JSR166TestCase { @@ -176,7 +180,6 @@ public class ForkJoinTask8Test extends J } catch (Throwable fail) { threadUnexpectedException(fail); } } - public static final class FJException extends RuntimeException { FJException() { super(); } } @@ -726,10 +729,13 @@ public class ForkJoinTask8Test extends J AsyncFib f = new AsyncFib(8); AsyncFib g = new AsyncFib(9); AsyncFib h = null; - try { - invokeAll(f, g, h); - shouldThrow(); - } catch (NullPointerException success) {} + Runnable[] throwingActions = { + () -> invokeAll(h), + () -> invokeAll(f, g, h), + () -> invokeAll(f, h, g), + () -> invokeAll(h, f, g), + }; + assertThrows(NullPointerException.class, throwingActions); }}; testInvokeOnPool(mainPool(), a); }