--- jsr166/src/test/tck/JSR166TestCase.java 2013/02/06 16:55:50 1.100 +++ jsr166/src/test/tck/JSR166TestCase.java 2013/04/01 20:06:26 1.106 @@ -286,8 +286,15 @@ public class JSR166TestCase extends Test // Java8+ test classes if (atLeastJava8()) { String[] java8TestClassNames = { - "StampedLockTest", + "CompletableFutureTest", + "ConcurrentHashMap8Test", + "CountedCompleterTest", + "DoubleAccumulatorTest", + "DoubleAdderTest", "ForkJoinPool8Test", + "LongAccumulatorTest", + "LongAdderTest", + "StampedLockTest", }; addNamedTestClasses(suite, java8TestClassNames); } @@ -408,7 +415,7 @@ public class JSR166TestCase extends Test } } } - + /** * Just like fail(reason), but additionally recording (using * threadRecordFailure) any AssertionFailedError thrown, so that @@ -1341,4 +1348,25 @@ public class JSR166TestCase extends Test return null; } } + + public void assertThrows(Class expectedExceptionClass, + Runnable... throwingActions) { + for (Runnable throwingAction : throwingActions) { + boolean threw = false; + try { throwingAction.run(); } + catch (Throwable t) { + threw = true; + if (!expectedExceptionClass.isInstance(t)) { + AssertionFailedError afe = + new AssertionFailedError + ("Expected " + expectedExceptionClass.getName() + + ", got " + t.getClass().getName()); + afe.initCause(t); + threadUnexpectedException(afe); + } + } + if (!threw) + shouldThrow(expectedExceptionClass.getName()); + } + } }