1 |
jsr166 |
1.1 |
/* |
2 |
|
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
|
* Expert Group and released to the public domain, as explained at |
4 |
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
|
*/ |
6 |
|
|
|
7 |
|
|
import junit.framework.*; |
8 |
|
|
import java.util.concurrent.ForkJoinPool; |
9 |
|
|
import java.util.concurrent.ForkJoinTask; |
10 |
|
|
import java.util.concurrent.ForkJoinWorkerThread; |
11 |
|
|
|
12 |
|
|
public class ForkJoinPool8Test extends JSR166TestCase { |
13 |
|
|
public static void main(String[] args) { |
14 |
|
|
junit.textui.TestRunner.run(suite()); |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
public static Test suite() { |
18 |
|
|
return new TestSuite(ForkJoinPool8Test.class); |
19 |
|
|
} |
20 |
|
|
|
21 |
|
|
/** |
22 |
|
|
* Common pool exists and has expected parallelism. |
23 |
|
|
*/ |
24 |
|
|
public void testCommonPoolParallelism() { |
25 |
|
|
assertEquals(ForkJoinPool.getCommonPoolParallelism(), |
26 |
|
|
ForkJoinPool.commonPool().getParallelism()); |
27 |
|
|
} |
28 |
|
|
} |