--- jsr166/src/test/tck/JSR166TestCase.java 2006/04/20 20:35:00 1.30 +++ jsr166/src/test/tck/JSR166TestCase.java 2009/07/31 23:02:49 1.32 @@ -108,6 +108,13 @@ public class JSR166TestCase extends Test public static Test suite ( ) { TestSuite suite = new TestSuite("JSR166 Unit Tests"); + suite.addTest(new TestSuite(ForkJoinPoolTest.class)); + suite.addTest(new TestSuite(ForkJoinTaskTest.class)); + suite.addTest(new TestSuite(RecursiveActionTest.class)); + suite.addTest(new TestSuite(RecursiveTaskTest.class)); + suite.addTest(new TestSuite(LinkedTransferQueueTest.class)); + suite.addTest(new TestSuite(PhaserTest.class)); + suite.addTest(new TestSuite(ThreadLocalRandomTest.class)); suite.addTest(new TestSuite(AbstractExecutorServiceTest.class)); suite.addTest(new TestSuite(AbstractQueueTest.class)); suite.addTest(new TestSuite(AbstractQueuedSynchronizerTest.class)); @@ -279,10 +286,15 @@ public class JSR166TestCase extends Test /** * threadFail with message "should throw exception" - */ + */ public void threadShouldThrow() { - threadFailed = true; - fail("should throw exception"); + try { + threadFailed = true; + fail("should throw exception"); + } catch (AssertionFailedError e) { + e.printStackTrace(); + throw e; + } } /** @@ -293,6 +305,14 @@ public class JSR166TestCase extends Test fail("Unexpected exception"); } + /** + * threadFail with message "Unexpected exception", with argument + */ + public void threadUnexpectedException(Throwable ex) { + threadFailed = true; + ex.printStackTrace(); + fail("Unexpected exception: " + ex); + } /** * Wait out termination of a thread pool or fail doing so @@ -402,7 +422,7 @@ public class JSR166TestCase extends Test Thread.sleep(SHORT_DELAY_MS); } catch(Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } } @@ -424,7 +444,7 @@ public class JSR166TestCase extends Test Thread.sleep(SMALL_DELAY_MS); } catch(Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } } @@ -445,7 +465,7 @@ public class JSR166TestCase extends Test Thread.sleep(SMALL_DELAY_MS); } catch(Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } return Boolean.TRUE; } @@ -469,7 +489,7 @@ public class JSR166TestCase extends Test Thread.sleep(MEDIUM_DELAY_MS); } catch(Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } }