125 |
|
} catch (Throwable fail) { threadUnexpectedException(fail); } |
126 |
|
} |
127 |
|
|
128 |
< |
void checkTaskThrew(RecursiveAction a, Throwable t) { |
128 |
> |
void checkCompletedAbnormally(RecursiveAction a, Throwable t) { |
129 |
|
assertTrue(a.isDone()); |
130 |
|
assertFalse(a.isCancelled()); |
131 |
|
assertFalse(a.isCompletedNormally()); |
333 |
|
f.invoke(); |
334 |
|
shouldThrow(); |
335 |
|
} catch (FJException success) { |
336 |
< |
checkTaskThrew(f, success); |
336 |
> |
checkCompletedAbnormally(f, success); |
337 |
|
} |
338 |
|
}}; |
339 |
|
testInvokeOnPool(mainPool(), a); |
348 |
|
FailingFibAction f = new FailingFibAction(8); |
349 |
|
f.quietlyInvoke(); |
350 |
|
assertTrue(f.getException() instanceof FJException); |
351 |
< |
checkTaskThrew(f, f.getException()); |
351 |
> |
checkCompletedAbnormally(f, f.getException()); |
352 |
|
}}; |
353 |
|
testInvokeOnPool(mainPool(), a); |
354 |
|
} |
365 |
|
f.join(); |
366 |
|
shouldThrow(); |
367 |
|
} catch (FJException success) { |
368 |
< |
checkTaskThrew(f, success); |
368 |
> |
checkCompletedAbnormally(f, success); |
369 |
|
} |
370 |
|
}}; |
371 |
|
testInvokeOnPool(mainPool(), a); |
383 |
|
f.get(); |
384 |
|
shouldThrow(); |
385 |
|
} catch (ExecutionException success) { |
386 |
< |
checkTaskThrew(f, success.getCause()); |
386 |
> |
Throwable cause = success.getCause(); |
387 |
> |
assertTrue(cause instanceof FJException); |
388 |
> |
checkCompletedAbnormally(f, cause); |
389 |
|
} |
390 |
|
}}; |
391 |
|
testInvokeOnPool(mainPool(), a); |
403 |
|
f.get(5L, TimeUnit.SECONDS); |
404 |
|
shouldThrow(); |
405 |
|
} catch (ExecutionException success) { |
406 |
< |
checkTaskThrew(f, success.getCause()); |
406 |
> |
Throwable cause = success.getCause(); |
407 |
> |
assertTrue(cause instanceof FJException); |
408 |
> |
checkCompletedAbnormally(f, cause); |
409 |
|
} |
410 |
|
}}; |
411 |
|
testInvokeOnPool(mainPool(), a); |
421 |
|
assertSame(f, f.fork()); |
422 |
|
f.quietlyJoin(); |
423 |
|
assertTrue(f.getException() instanceof FJException); |
424 |
< |
checkTaskThrew(f, f.getException()); |
424 |
> |
checkCompletedAbnormally(f, f.getException()); |
425 |
|
}}; |
426 |
|
testInvokeOnPool(mainPool(), a); |
427 |
|
} |
634 |
|
f.invoke(); |
635 |
|
shouldThrow(); |
636 |
|
} catch (FJException success) { |
637 |
< |
checkTaskThrew(f, success); |
637 |
> |
checkCompletedAbnormally(f, success); |
638 |
|
} |
639 |
|
}}; |
640 |
|
testInvokeOnPool(mainPool(), a); |
766 |
|
invokeAll(f, g); |
767 |
|
shouldThrow(); |
768 |
|
} catch (FJException success) { |
769 |
< |
checkTaskThrew(g, success); |
769 |
> |
checkCompletedAbnormally(g, success); |
770 |
|
} |
771 |
|
}}; |
772 |
|
testInvokeOnPool(mainPool(), a); |
783 |
|
invokeAll(g); |
784 |
|
shouldThrow(); |
785 |
|
} catch (FJException success) { |
786 |
< |
checkTaskThrew(g, success); |
786 |
> |
checkCompletedAbnormally(g, success); |
787 |
|
} |
788 |
|
}}; |
789 |
|
testInvokeOnPool(mainPool(), a); |
802 |
|
invokeAll(f, g, h); |
803 |
|
shouldThrow(); |
804 |
|
} catch (FJException success) { |
805 |
< |
checkTaskThrew(g, success); |
805 |
> |
checkCompletedAbnormally(g, success); |
806 |
|
} |
807 |
|
}}; |
808 |
|
testInvokeOnPool(mainPool(), a); |
825 |
|
invokeAll(set); |
826 |
|
shouldThrow(); |
827 |
|
} catch (FJException success) { |
828 |
< |
checkTaskThrew(f, success); |
828 |
> |
checkCompletedAbnormally(f, success); |
829 |
|
} |
830 |
|
}}; |
831 |
|
testInvokeOnPool(mainPool(), a); |
865 |
|
assertSame(f, f.fork()); |
866 |
|
assertTrue(getSurplusQueuedTaskCount() > 0); |
867 |
|
helpQuiesce(); |
868 |
+ |
assertEquals(0, getSurplusQueuedTaskCount()); |
869 |
|
checkCompletedNormally(f); |
870 |
|
checkCompletedNormally(g); |
871 |
|
checkCompletedNormally(h); |