17 |
|
import java.util.concurrent.SynchronousQueue; |
18 |
|
import java.util.concurrent.ThreadLocalRandom; |
19 |
|
import java.util.concurrent.TimeoutException; |
20 |
– |
import java.util.concurrent.TimeUnit; |
20 |
|
|
21 |
|
import junit.framework.Test; |
22 |
|
import junit.framework.TestSuite; |
24 |
|
public class RecursiveActionTest extends JSR166TestCase { |
25 |
|
|
26 |
|
public static void main(String[] args) { |
27 |
< |
junit.textui.TestRunner.run(suite()); |
27 |
> |
main(suite(), args); |
28 |
|
} |
29 |
|
|
30 |
|
public static Test suite() { |
46 |
|
} |
47 |
|
|
48 |
|
private void testInvokeOnPool(ForkJoinPool pool, RecursiveAction a) { |
49 |
< |
try { |
49 |
> |
try (PoolCleaner cleaner = cleaner(pool)) { |
50 |
|
checkNotDone(a); |
51 |
|
|
52 |
|
assertNull(pool.invoke(a)); |
53 |
|
|
54 |
|
checkCompletedNormally(a); |
56 |
– |
} finally { |
57 |
– |
joinPool(pool); |
55 |
|
} |
56 |
|
} |
57 |
|
|