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.28 by dl, Fri May 20 16:30:17 2005 UTC vs.
Revision 1.32 by dl, Fri Jul 31 23:02:49 2009 UTC

# Line 108 | Line 108 | public class JSR166TestCase extends Test
108      public static Test suite ( ) {
109          TestSuite suite = new TestSuite("JSR166 Unit Tests");
110  
111 +        suite.addTest(new TestSuite(ForkJoinPoolTest.class));
112 +        suite.addTest(new TestSuite(ForkJoinTaskTest.class));
113 +        suite.addTest(new TestSuite(RecursiveActionTest.class));
114 +        suite.addTest(new TestSuite(RecursiveTaskTest.class));
115 +        suite.addTest(new TestSuite(LinkedTransferQueueTest.class));
116 +        suite.addTest(new TestSuite(PhaserTest.class));
117 +        suite.addTest(new TestSuite(ThreadLocalRandomTest.class));
118          suite.addTest(new TestSuite(AbstractExecutorServiceTest.class));
119          suite.addTest(new TestSuite(AbstractQueueTest.class));
120          suite.addTest(new TestSuite(AbstractQueuedSynchronizerTest.class));
# Line 137 | Line 144 | public class JSR166TestCase extends Test
144          suite.addTest(new TestSuite(CountDownLatchTest.class));
145          suite.addTest(new TestSuite(CyclicBarrierTest.class));
146          suite.addTest(new TestSuite(DelayQueueTest.class));
147 +        suite.addTest(new TestSuite(EntryTest.class));
148          suite.addTest(new TestSuite(ExchangerTest.class));
149          suite.addTest(new TestSuite(ExecutorsTest.class));
150          suite.addTest(new TestSuite(ExecutorCompletionServiceTest.class));
# Line 278 | Line 286 | public class JSR166TestCase extends Test
286  
287      /**
288       * threadFail with message "should throw exception"
289 <     */
289 >     */
290      public void threadShouldThrow() {
291 <        threadFailed = true;
292 <        fail("should throw exception");
291 >       try {
292 >           threadFailed = true;
293 >           fail("should throw exception");
294 >       } catch (AssertionFailedError e) {
295 >           e.printStackTrace();
296 >           throw e;
297 >       }
298      }
299  
300      /**
# Line 292 | Line 305 | public class JSR166TestCase extends Test
305          fail("Unexpected exception");
306      }
307  
308 +    /**
309 +     * threadFail with message "Unexpected exception", with argument
310 +     */
311 +    public void threadUnexpectedException(Throwable ex) {
312 +        threadFailed = true;
313 +        ex.printStackTrace();
314 +        fail("Unexpected exception: " + ex);
315 +    }
316  
317      /**
318       * Wait out termination of a thread pool or fail doing so
# Line 345 | Line 366 | public class JSR166TestCase extends Test
366      static final Integer m3  = new Integer(-3);
367      static final Integer m4 = new Integer(-4);
368      static final Integer m5 = new Integer(-5);
369 +    static final Integer m6 = new Integer(-6);
370      static final Integer m10 = new Integer(-10);
371  
372  
# Line 400 | Line 422 | public class JSR166TestCase extends Test
422                  Thread.sleep(SHORT_DELAY_MS);
423              }
424              catch(Exception e) {
425 <                threadUnexpectedException();
425 >                threadUnexpectedException(e);
426              }
427          }
428      }
# Line 422 | Line 444 | public class JSR166TestCase extends Test
444                  Thread.sleep(SMALL_DELAY_MS);
445              }
446              catch(Exception e) {
447 <                threadUnexpectedException();
447 >                threadUnexpectedException(e);
448              }
449          }
450      }
# Line 443 | Line 465 | public class JSR166TestCase extends Test
465                  Thread.sleep(SMALL_DELAY_MS);
466              }
467              catch(Exception e) {
468 <                threadUnexpectedException();
468 >                threadUnexpectedException(e);
469              }
470              return Boolean.TRUE;
471          }
# Line 467 | Line 489 | public class JSR166TestCase extends Test
489                  Thread.sleep(MEDIUM_DELAY_MS);
490              }
491              catch(Exception e) {
492 <                threadUnexpectedException();
492 >                threadUnexpectedException(e);
493              }
494          }
495      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines