4 |
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
< |
import junit.framework.*; |
7 |
> |
import static java.util.concurrent.TimeUnit.SECONDS; |
8 |
> |
|
9 |
> |
import java.util.HashSet; |
10 |
|
import java.util.concurrent.CancellationException; |
11 |
|
import java.util.concurrent.ExecutionException; |
12 |
|
import java.util.concurrent.ForkJoinPool; |
13 |
|
import java.util.concurrent.ForkJoinTask; |
12 |
– |
import java.util.concurrent.ForkJoinWorkerThread; |
14 |
|
import java.util.concurrent.RecursiveTask; |
14 |
– |
import java.util.concurrent.TimeUnit; |
15 |
|
import java.util.concurrent.TimeoutException; |
16 |
< |
import static java.util.concurrent.TimeUnit.SECONDS; |
17 |
< |
import java.util.HashSet; |
16 |
> |
|
17 |
> |
import junit.framework.Test; |
18 |
> |
import junit.framework.TestSuite; |
19 |
|
|
20 |
|
public class RecursiveTaskTest extends JSR166TestCase { |
21 |
|
|
320 |
|
assertEquals(21, (int) testInvokeOnPool(mainPool(), a)); |
321 |
|
} |
322 |
|
|
322 |
– |
|
323 |
|
/** |
324 |
|
* helpQuiesce returns when tasks are complete. |
325 |
|
* getQueuedTaskCount returns 0 when quiescent |
337 |
|
assertSame(NoResult, testInvokeOnPool(mainPool(), a)); |
338 |
|
} |
339 |
|
|
340 |
– |
|
340 |
|
/** |
341 |
|
* invoke task throws exception when task completes abnormally |
342 |
|
*/ |
762 |
|
assertSame(NoResult, testInvokeOnPool(mainPool(), a)); |
763 |
|
} |
764 |
|
|
766 |
– |
|
765 |
|
/** |
766 |
|
* invokeAll(tasks) with any null task throws NPE |
767 |
|
*/ |