--- jsr166/src/test/tck/JSR166TestCase.java 2005/05/12 03:20:56 1.27 +++ jsr166/src/test/tck/JSR166TestCase.java 2008/04/13 14:16:25 1.31 @@ -137,6 +137,7 @@ public class JSR166TestCase extends Test suite.addTest(new TestSuite(CountDownLatchTest.class)); suite.addTest(new TestSuite(CyclicBarrierTest.class)); suite.addTest(new TestSuite(DelayQueueTest.class)); + suite.addTest(new TestSuite(EntryTest.class)); suite.addTest(new TestSuite(ExchangerTest.class)); suite.addTest(new TestSuite(ExecutorsTest.class)); suite.addTest(new TestSuite(ExecutorCompletionServiceTest.class)); @@ -150,11 +151,13 @@ public class JSR166TestCase extends Test suite.addTest(new TestSuite(ReentrantLockTest.class)); suite.addTest(new TestSuite(ReentrantReadWriteLockTest.class)); suite.addTest(new TestSuite(ScheduledExecutorTest.class)); + suite.addTest(new TestSuite(ScheduledExecutorSubclassTest.class)); suite.addTest(new TestSuite(SemaphoreTest.class)); suite.addTest(new TestSuite(SynchronousQueueTest.class)); suite.addTest(new TestSuite(SystemTest.class)); suite.addTest(new TestSuite(ThreadLocalTest.class)); suite.addTest(new TestSuite(ThreadPoolExecutorTest.class)); + suite.addTest(new TestSuite(ThreadPoolExecutorSubclassTest.class)); suite.addTest(new TestSuite(ThreadTest.class)); suite.addTest(new TestSuite(TimeUnitTest.class)); suite.addTest(new TestSuite(TreeMapTest.class)); @@ -276,10 +279,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; + } } /** @@ -290,6 +298,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 @@ -343,6 +359,7 @@ public class JSR166TestCase extends Test static final Integer m3 = new Integer(-3); static final Integer m4 = new Integer(-4); static final Integer m5 = new Integer(-5); + static final Integer m6 = new Integer(-6); static final Integer m10 = new Integer(-10); @@ -398,7 +415,7 @@ public class JSR166TestCase extends Test Thread.sleep(SHORT_DELAY_MS); } catch(Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } } @@ -420,7 +437,7 @@ public class JSR166TestCase extends Test Thread.sleep(SMALL_DELAY_MS); } catch(Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } } @@ -441,7 +458,7 @@ public class JSR166TestCase extends Test Thread.sleep(SMALL_DELAY_MS); } catch(Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } return Boolean.TRUE; } @@ -465,7 +482,7 @@ public class JSR166TestCase extends Test Thread.sleep(MEDIUM_DELAY_MS); } catch(Exception e) { - threadUnexpectedException(); + threadUnexpectedException(e); } } }