13 |
|
public static void main(String[] args) { |
14 |
|
junit.textui.TestRunner.run(suite()); |
15 |
|
} |
16 |
+ |
|
17 |
|
public static Test suite() { |
18 |
|
return new TestSuite(RecursiveActionTest.class); |
19 |
|
} |
20 |
|
|
21 |
|
static final ForkJoinPool mainPool = new ForkJoinPool(); |
22 |
|
static final ForkJoinPool singletonPool = new ForkJoinPool(1); |
23 |
< |
static final ForkJoinPool asyncSingletonPool = |
24 |
< |
new ForkJoinPool(1, ForkJoinPool.defaultForkJoinWorkerThreadFactory, |
23 |
> |
static final ForkJoinPool asyncSingletonPool = |
24 |
> |
new ForkJoinPool(1, ForkJoinPool.defaultForkJoinWorkerThreadFactory, |
25 |
|
null, true); |
26 |
|
|
27 |
|
static final class FJException extends RuntimeException { |
68 |
|
* invoke returns when task completes normally. |
69 |
|
* isCompletedAbnormally and isCancelled return false for normally |
70 |
|
* completed tasks. getRawResult of a RecursiveAction returns null; |
70 |
– |
* |
71 |
|
*/ |
72 |
|
public void testInvoke() { |
73 |
|
RecursiveAction a = new RecursiveAction() { |
460 |
|
|
461 |
|
/** |
462 |
|
* getPoolIndex of current thread in pool returns 0 <= value < poolSize |
463 |
– |
* |
463 |
|
*/ |
464 |
|
public void testWorkerGetPoolIndex() { |
465 |
|
RecursiveAction a = new RecursiveAction() { |