--- jsr166/src/test/tck/JSR166TestCase.java 2016/03/26 06:58:47 1.190 +++ jsr166/src/test/tck/JSR166TestCase.java 2016/05/23 18:19:48 1.193 @@ -58,6 +58,7 @@ import java.util.concurrent.RecursiveAct import java.util.concurrent.RecursiveTask; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.Semaphore; +import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeoutException; @@ -519,7 +520,7 @@ public class JSR166TestCase extends Test // Java9+ test classes if (atLeastJava9()) { String[] java9TestClassNames = { - // Currently empty, but expecting varhandle tests + "ExecutorCompletionService9Test", }; addNamedTestClasses(suite, java9TestClassNames); } @@ -1833,4 +1834,19 @@ public class JSR166TestCase extends Test } catch (NoSuchElementException success) {} assertFalse(it.hasNext()); } + + public Callable callableThrowing(final Exception ex) { + return new Callable() { public T call() throws Exception { throw ex; }}; + } + + public Runnable runnableThrowing(final RuntimeException ex) { + return new Runnable() { public void run() { throw ex; }}; + } + + /** A reusable thread pool to be shared by tests. */ + static final ExecutorService cachedThreadPool = + new ThreadPoolExecutor(0, Integer.MAX_VALUE, + 1000L, MILLISECONDS, + new SynchronousQueue()); + }