460 |
|
public static boolean atLeastJava9() { return JAVA_CLASS_VERSION >= 53.0; } |
461 |
|
public static boolean atLeastJava10() { return JAVA_CLASS_VERSION >= 54.0; } |
462 |
|
public static boolean atLeastJava11() { return JAVA_CLASS_VERSION >= 55.0; } |
463 |
+ |
public static boolean atLeastJava12() { return JAVA_CLASS_VERSION >= 56.0; } |
464 |
+ |
public static boolean atLeastJava13() { return JAVA_CLASS_VERSION >= 57.0; } |
465 |
+ |
public static boolean atLeastJava14() { return JAVA_CLASS_VERSION >= 58.0; } |
466 |
+ |
public static boolean atLeastJava15() { return JAVA_CLASS_VERSION >= 59.0; } |
467 |
+ |
public static boolean atLeastJava16() { return JAVA_CLASS_VERSION >= 60.0; } |
468 |
+ |
public static boolean atLeastJava17() { return JAVA_CLASS_VERSION >= 61.0; } |
469 |
|
|
470 |
|
/** |
471 |
|
* Collects all JSR166 unit tests as one suite. |
517 |
|
ExecutorsTest.suite(), |
518 |
|
ExecutorCompletionServiceTest.suite(), |
519 |
|
FutureTaskTest.suite(), |
520 |
+ |
HashtableTest.suite(), |
521 |
|
LinkedBlockingDequeTest.suite(), |
522 |
|
LinkedBlockingQueueTest.suite(), |
523 |
|
LinkedListTest.suite(), |
557 |
|
"HashMapTest", |
558 |
|
"LinkedBlockingDeque8Test", |
559 |
|
"LinkedBlockingQueue8Test", |
560 |
+ |
"LinkedHashMapTest", |
561 |
|
"LongAccumulatorTest", |
562 |
|
"LongAdderTest", |
563 |
|
"SplittableRandomTest", |
1313 |
|
Callable<Boolean> waitingForGodot) { |
1314 |
|
for (long startTime = 0L;;) { |
1315 |
|
switch (thread.getState()) { |
1316 |
+ |
default: break; |
1317 |
|
case BLOCKED: case WAITING: case TIMED_WAITING: |
1318 |
|
try { |
1319 |
|
if (waitingForGodot == null || waitingForGodot.call()) |
1618 |
|
public String call() { throw new NullPointerException(); } |
1619 |
|
} |
1620 |
|
|
1612 |
– |
public class SmallPossiblyInterruptedRunnable extends CheckedRunnable { |
1613 |
– |
protected void realRun() { |
1614 |
– |
try { |
1615 |
– |
delay(SMALL_DELAY_MS); |
1616 |
– |
} catch (InterruptedException ok) {} |
1617 |
– |
} |
1618 |
– |
} |
1619 |
– |
|
1621 |
|
public Runnable possiblyInterruptedRunnable(final long timeoutMillis) { |
1622 |
|
return new CheckedRunnable() { |
1623 |
|
protected void realRun() { |
1751 |
|
} |
1752 |
|
} |
1753 |
|
|
1754 |
< |
void assertImmutable(final Object o) { |
1754 |
> |
void assertImmutable(Object o) { |
1755 |
|
if (o instanceof Collection) { |
1756 |
|
assertThrows( |
1757 |
|
UnsupportedOperationException.class, |
1758 |
< |
new Runnable() { public void run() { |
1758 |
< |
((Collection) o).add(null);}}); |
1758 |
> |
() -> ((Collection) o).add(null)); |
1759 |
|
} |
1760 |
|
} |
1761 |
|
|
1815 |
|
} |
1816 |
|
|
1817 |
|
public void assertThrows(Class<? extends Throwable> expectedExceptionClass, |
1818 |
< |
Runnable... throwingActions) { |
1819 |
< |
for (Runnable throwingAction : throwingActions) { |
1818 |
> |
Action... throwingActions) { |
1819 |
> |
for (Action throwingAction : throwingActions) { |
1820 |
|
boolean threw = false; |
1821 |
|
try { throwingAction.run(); } |
1822 |
|
catch (Throwable t) { |