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.30 by dl, Thu Apr 20 20:35:00 2006 UTC vs.
Revision 1.31 by dl, Sun Apr 13 14:16:25 2008 UTC

# Line 279 | 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 293 | 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 402 | 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 424 | 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 445 | 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 469 | 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