ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.27 by jsr166, Thu May 12 03:20:56 2005 UTC vs.
Revision 1.31 by dl, Sun Apr 13 14:16:25 2008 UTC

# Line 137 | Line 137 | public class JSR166TestCase extends Test
137          suite.addTest(new TestSuite(CountDownLatchTest.class));
138          suite.addTest(new TestSuite(CyclicBarrierTest.class));
139          suite.addTest(new TestSuite(DelayQueueTest.class));
140 +        suite.addTest(new TestSuite(EntryTest.class));
141          suite.addTest(new TestSuite(ExchangerTest.class));
142          suite.addTest(new TestSuite(ExecutorsTest.class));
143          suite.addTest(new TestSuite(ExecutorCompletionServiceTest.class));
# Line 150 | Line 151 | public class JSR166TestCase extends Test
151          suite.addTest(new TestSuite(ReentrantLockTest.class));
152          suite.addTest(new TestSuite(ReentrantReadWriteLockTest.class));
153          suite.addTest(new TestSuite(ScheduledExecutorTest.class));
154 +        suite.addTest(new TestSuite(ScheduledExecutorSubclassTest.class));
155          suite.addTest(new TestSuite(SemaphoreTest.class));
156          suite.addTest(new TestSuite(SynchronousQueueTest.class));
157          suite.addTest(new TestSuite(SystemTest.class));
158          suite.addTest(new TestSuite(ThreadLocalTest.class));
159          suite.addTest(new TestSuite(ThreadPoolExecutorTest.class));
160 +        suite.addTest(new TestSuite(ThreadPoolExecutorSubclassTest.class));
161          suite.addTest(new TestSuite(ThreadTest.class));
162          suite.addTest(new TestSuite(TimeUnitTest.class));
163          suite.addTest(new TestSuite(TreeMapTest.class));
# Line 276 | Line 279 | public class JSR166TestCase extends Test
279  
280      /**
281       * threadFail with message "should throw exception"
282 <     */
282 >     */
283      public void threadShouldThrow() {
284 <        threadFailed = true;
285 <        fail("should throw exception");
284 >       try {
285 >           threadFailed = true;
286 >           fail("should throw exception");
287 >       } catch (AssertionFailedError e) {
288 >           e.printStackTrace();
289 >           throw e;
290 >       }
291      }
292  
293      /**
# Line 290 | Line 298 | public class JSR166TestCase extends Test
298          fail("Unexpected exception");
299      }
300  
301 +    /**
302 +     * threadFail with message "Unexpected exception", with argument
303 +     */
304 +    public void threadUnexpectedException(Throwable ex) {
305 +        threadFailed = true;
306 +        ex.printStackTrace();
307 +        fail("Unexpected exception: " + ex);
308 +    }
309  
310      /**
311       * Wait out termination of a thread pool or fail doing so
# Line 343 | Line 359 | public class JSR166TestCase extends Test
359      static final Integer m3  = new Integer(-3);
360      static final Integer m4 = new Integer(-4);
361      static final Integer m5 = new Integer(-5);
362 +    static final Integer m6 = new Integer(-6);
363      static final Integer m10 = new Integer(-10);
364  
365  
# Line 398 | Line 415 | public class JSR166TestCase extends Test
415                  Thread.sleep(SHORT_DELAY_MS);
416              }
417              catch(Exception e) {
418 <                threadUnexpectedException();
418 >                threadUnexpectedException(e);
419              }
420          }
421      }
# Line 420 | Line 437 | public class JSR166TestCase extends Test
437                  Thread.sleep(SMALL_DELAY_MS);
438              }
439              catch(Exception e) {
440 <                threadUnexpectedException();
440 >                threadUnexpectedException(e);
441              }
442          }
443      }
# Line 441 | Line 458 | public class JSR166TestCase extends Test
458                  Thread.sleep(SMALL_DELAY_MS);
459              }
460              catch(Exception e) {
461 <                threadUnexpectedException();
461 >                threadUnexpectedException(e);
462              }
463              return Boolean.TRUE;
464          }
# Line 465 | Line 482 | public class JSR166TestCase extends Test
482                  Thread.sleep(MEDIUM_DELAY_MS);
483              }
484              catch(Exception e) {
485 <                threadUnexpectedException();
485 >                threadUnexpectedException(e);
486              }
487          }
488      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines