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)); |
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 |
|
/** |
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 |
422 |
|
Thread.sleep(SHORT_DELAY_MS); |
423 |
|
} |
424 |
|
catch(Exception e) { |
425 |
< |
threadUnexpectedException(); |
425 |
> |
threadUnexpectedException(e); |
426 |
|
} |
427 |
|
} |
428 |
|
} |
444 |
|
Thread.sleep(SMALL_DELAY_MS); |
445 |
|
} |
446 |
|
catch(Exception e) { |
447 |
< |
threadUnexpectedException(); |
447 |
> |
threadUnexpectedException(e); |
448 |
|
} |
449 |
|
} |
450 |
|
} |
465 |
|
Thread.sleep(SMALL_DELAY_MS); |
466 |
|
} |
467 |
|
catch(Exception e) { |
468 |
< |
threadUnexpectedException(); |
468 |
> |
threadUnexpectedException(e); |
469 |
|
} |
470 |
|
return Boolean.TRUE; |
471 |
|
} |
489 |
|
Thread.sleep(MEDIUM_DELAY_MS); |
490 |
|
} |
491 |
|
catch(Exception e) { |
492 |
< |
threadUnexpectedException(); |
492 |
> |
threadUnexpectedException(e); |
493 |
|
} |
494 |
|
} |
495 |
|
} |