8 |
|
import static java.util.concurrent.TimeUnit.SECONDS; |
9 |
|
|
10 |
|
import java.util.Arrays; |
11 |
– |
import java.util.Collections; |
11 |
|
import java.util.HashSet; |
13 |
– |
import java.util.List; |
12 |
|
import java.util.concurrent.CancellationException; |
13 |
|
import java.util.concurrent.ExecutionException; |
14 |
|
import java.util.concurrent.ForkJoinPool; |
895 |
|
AsyncFib f = new AsyncFib(8); |
896 |
|
FailingAsyncFib g = new FailingAsyncFib(9); |
897 |
|
ForkJoinTask[] tasks = { f, g }; |
898 |
< |
Collections.shuffle(Arrays.asList(tasks)); |
898 |
> |
shuffle(tasks); |
899 |
|
try { |
900 |
|
invokeAll(tasks); |
901 |
|
shouldThrow(); |
933 |
|
FailingAsyncFib g = new FailingAsyncFib(9); |
934 |
|
AsyncFib h = new AsyncFib(7); |
935 |
|
ForkJoinTask[] tasks = { f, g, h }; |
936 |
< |
Collections.shuffle(Arrays.asList(tasks)); |
936 |
> |
shuffle(tasks); |
937 |
|
try { |
938 |
|
invokeAll(tasks); |
939 |
|
shouldThrow(); |
954 |
|
AsyncFib g = new AsyncFib(9); |
955 |
|
AsyncFib h = new AsyncFib(7); |
956 |
|
ForkJoinTask[] tasks = { f, g, h }; |
957 |
< |
List taskList = Arrays.asList(tasks); |
960 |
< |
Collections.shuffle(taskList); |
957 |
> |
shuffle(tasks); |
958 |
|
try { |
959 |
< |
invokeAll(taskList); |
959 |
> |
invokeAll(Arrays.asList(tasks)); |
960 |
|
shouldThrow(); |
961 |
|
} catch (FJException success) { |
962 |
|
checkCompletedAbnormally(f, success); |
1564 |
|
AsyncFib f = new AsyncFib(8); |
1565 |
|
FailingAsyncFib g = new FailingAsyncFib(9); |
1566 |
|
ForkJoinTask[] tasks = { f, g }; |
1567 |
< |
Collections.shuffle(Arrays.asList(tasks)); |
1567 |
> |
shuffle(tasks); |
1568 |
|
try { |
1569 |
|
invokeAll(tasks); |
1570 |
|
shouldThrow(); |
1602 |
|
FailingAsyncFib g = new FailingAsyncFib(9); |
1603 |
|
AsyncFib h = new AsyncFib(7); |
1604 |
|
ForkJoinTask[] tasks = { f, g, h }; |
1605 |
< |
Collections.shuffle(Arrays.asList(tasks)); |
1605 |
> |
shuffle(tasks); |
1606 |
|
try { |
1607 |
|
invokeAll(tasks); |
1608 |
|
shouldThrow(); |
1623 |
|
AsyncFib g = new AsyncFib(9); |
1624 |
|
AsyncFib h = new AsyncFib(7); |
1625 |
|
ForkJoinTask[] tasks = { f, g, h }; |
1626 |
< |
List taskList = Arrays.asList(tasks); |
1630 |
< |
Collections.shuffle(taskList); |
1626 |
> |
shuffle(tasks); |
1627 |
|
try { |
1628 |
< |
invokeAll(taskList); |
1628 |
> |
invokeAll(Arrays.asList(tasks)); |
1629 |
|
shouldThrow(); |
1630 |
|
} catch (FJException success) { |
1631 |
|
checkCompletedAbnormally(f, success); |