--- jsr166/src/test/tck/ForkJoinTask8Test.java 2015/02/07 22:32:48 1.12 +++ jsr166/src/test/tck/ForkJoinTask8Test.java 2015/02/07 22:46:06 1.13 @@ -8,6 +8,7 @@ import static java.util.concurrent.TimeU import static java.util.concurrent.TimeUnit.SECONDS; import java.util.Arrays; +import java.util.Collections; import java.util.concurrent.ExecutionException; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.ForkJoinTask; @@ -873,21 +874,20 @@ public class ForkJoinTask8Test extends J } /** - * invokeAll(t1, t2) throw exception if any task does + * invokeAll(tasks) with 1 argument throws exception if task does */ - public void testAbnormalInvokeAll2() { - testAbnormalInvokeAll2(mainPool()); + public void testAbnormalInvokeAll1() { + testAbnormalInvokeAll1(mainPool()); } - public void testAbnormalInvokeAll2_Singleton() { - testAbnormalInvokeAll2(singletonPool()); + public void testAbnormalInvokeAll1_Singleton() { + testAbnormalInvokeAll1(singletonPool()); } - public void testAbnormalInvokeAll2(ForkJoinPool pool) { + public void testAbnormalInvokeAll1(ForkJoinPool pool) { RecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { - AsyncFib f = new AsyncFib(8); FailingAsyncFib g = new FailingAsyncFib(9); try { - invokeAll(f, g); + invokeAll(g); shouldThrow(); } catch (FJException success) { checkCompletedAbnormally(g, success); @@ -897,20 +897,23 @@ public class ForkJoinTask8Test extends J } /** - * invokeAll(tasks) with 1 argument throws exception if task does + * invokeAll(t1, t2) throw exception if any task does */ - public void testAbnormalInvokeAll1() { - testAbnormalInvokeAll1(mainPool()); + public void testAbnormalInvokeAll2() { + testAbnormalInvokeAll2(mainPool()); } - public void testAbnormalInvokeAll1_Singleton() { - testAbnormalInvokeAll1(singletonPool()); + public void testAbnormalInvokeAll2_Singleton() { + testAbnormalInvokeAll2(singletonPool()); } - public void testAbnormalInvokeAll1(ForkJoinPool pool) { + public void testAbnormalInvokeAll2(ForkJoinPool pool) { RecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { + AsyncFib f = new AsyncFib(8); FailingAsyncFib g = new FailingAsyncFib(9); + ForkJoinTask[] tasks = { f, g }; + Collections.shuffle(Arrays.asList(tasks)); try { - invokeAll(g); + invokeAll(tasks[0], tasks[1]); shouldThrow(); } catch (FJException success) { checkCompletedAbnormally(g, success); @@ -934,8 +937,10 @@ public class ForkJoinTask8Test extends J AsyncFib f = new AsyncFib(8); FailingAsyncFib g = new FailingAsyncFib(9); AsyncFib h = new AsyncFib(7); + ForkJoinTask[] tasks = { f, g, h }; + Collections.shuffle(Arrays.asList(tasks)); try { - invokeAll(f, g, h); + invokeAll(tasks[0], tasks[1], tasks[2]); shouldThrow(); } catch (FJException success) { checkCompletedAbnormally(g, success); @@ -960,6 +965,7 @@ public class ForkJoinTask8Test extends J AsyncFib g = new AsyncFib(9); AsyncFib h = new AsyncFib(7); ForkJoinTask[] tasks = { f, g, h }; + Collections.shuffle(Arrays.asList(tasks)); try { invokeAll(Arrays.asList(tasks)); shouldThrow();