128 |
|
private static final long profileThreshold = |
129 |
|
Long.getLong("jsr166.profileThreshold", 100); |
130 |
|
|
131 |
+ |
/** |
132 |
+ |
* The number of repetitions per test (for tickling rare bugs). |
133 |
+ |
*/ |
134 |
+ |
private static final int runsPerTest = |
135 |
+ |
Integer.getInteger("jsr166.runsPerTest", 1); |
136 |
+ |
|
137 |
|
protected void runTest() throws Throwable { |
138 |
< |
if (profileTests) |
139 |
< |
runTestProfiled(); |
140 |
< |
else |
141 |
< |
super.runTest(); |
138 |
> |
for (int i = 0; i < runsPerTest; i++) { |
139 |
> |
if (profileTests) |
140 |
> |
runTestProfiled(); |
141 |
> |
else |
142 |
> |
super.runTest(); |
143 |
> |
} |
144 |
|
} |
145 |
|
|
146 |
|
protected void runTestProfiled() throws Throwable { |
294 |
|
// Java8+ test classes |
295 |
|
if (atLeastJava8()) { |
296 |
|
String[] java8TestClassNames = { |
297 |
+ |
"Atomic8Test", |
298 |
|
"CompletableFutureTest", |
299 |
|
"ConcurrentHashMap8Test", |
300 |
|
"CountedCompleterTest", |
301 |
|
"DoubleAccumulatorTest", |
302 |
|
"DoubleAdderTest", |
303 |
|
"ForkJoinPool8Test", |
304 |
+ |
"ForkJoinTask8Test", |
305 |
|
"LongAccumulatorTest", |
306 |
|
"LongAdderTest", |
307 |
+ |
"SplittableRandomTest", |
308 |
|
"StampedLockTest", |
309 |
+ |
"ThreadLocalRandom8Test", |
310 |
|
}; |
311 |
|
addNamedTestClasses(suite, java8TestClassNames); |
312 |
|
} |
314 |
|
return suite; |
315 |
|
} |
316 |
|
|
317 |
+ |
// Delays for timing-dependent tests, in milliseconds. |
318 |
|
|
319 |
|
public static long SHORT_DELAY_MS; |
320 |
|
public static long SMALL_DELAY_MS; |
321 |
|
public static long MEDIUM_DELAY_MS; |
322 |
|
public static long LONG_DELAY_MS; |
323 |
|
|
311 |
– |
|
324 |
|
/** |
325 |
|
* Returns the shortest timed delay. This could |
326 |
|
* be reimplemented to use for example a Property. |
713 |
|
public static final Integer m6 = new Integer(-6); |
714 |
|
public static final Integer m10 = new Integer(-10); |
715 |
|
|
704 |
– |
|
716 |
|
/** |
717 |
|
* Runs Runnable r with a security policy that permits precisely |
718 |
|
* the specified permissions. If there is no current security |
1243 |
|
public abstract class CheckedRecursiveAction extends RecursiveAction { |
1244 |
|
protected abstract void realCompute() throws Throwable; |
1245 |
|
|
1246 |
< |
public final void compute() { |
1246 |
> |
@Override protected final void compute() { |
1247 |
|
try { |
1248 |
|
realCompute(); |
1249 |
|
} catch (Throwable t) { |
1258 |
|
public abstract class CheckedRecursiveTask<T> extends RecursiveTask<T> { |
1259 |
|
protected abstract T realCompute() throws Throwable; |
1260 |
|
|
1261 |
< |
public final T compute() { |
1261 |
> |
@Override protected final T compute() { |
1262 |
|
try { |
1263 |
|
return realCompute(); |
1264 |
|
} catch (Throwable t) { |