--- jsr166/src/test/tck/JSR166TestCase.java 2011/06/03 05:07:14 1.89 +++ jsr166/src/test/tck/JSR166TestCase.java 2011/06/22 07:46:57 1.90 @@ -528,6 +528,28 @@ public class JSR166TestCase extends Test } /** + * Checks that the threads do not terminate within the default + * millisecond delay of {@code timeoutMillis()}. + */ + void assertThreadsStayAlive(Thread... threads) { + assertThreadsStayAlive(timeoutMillis(), threads); + } + + /** + * Checks that the threads do not terminate within the given millisecond delay. + */ + void assertThreadsStayAlive(long millis, Thread... threads) { + try { + // No need to optimize the failing case via Thread.join. + delay(millis); + for (Thread thread : threads) + assertTrue(thread.isAlive()); + } catch (InterruptedException ie) { + fail("Unexpected InterruptedException"); + } + } + + /** * Checks that future.get times out, with the default timeout of * {@code timeoutMillis()}. */