776 |
|
} |
777 |
|
|
778 |
|
/** |
779 |
+ |
* completeExceptionally(null) surprisingly has the same effect as |
780 |
+ |
* completeExceptionally(new RuntimeException()) |
781 |
+ |
*/ |
782 |
+ |
public void testCompleteExceptionally_null() { |
783 |
+ |
RecursiveAction a = new CheckedRecursiveAction() { |
784 |
+ |
protected void realCompute() { |
785 |
+ |
AsyncFib f = new AsyncFib(8); |
786 |
+ |
f.completeExceptionally(null); |
787 |
+ |
try { |
788 |
+ |
f.invoke(); |
789 |
+ |
shouldThrow(); |
790 |
+ |
} catch (RuntimeException success) { |
791 |
+ |
assertSame(success.getClass(), RuntimeException.class); |
792 |
+ |
assertNull(success.getCause()); |
793 |
+ |
checkCompletedAbnormally(f, success); |
794 |
+ |
} |
795 |
+ |
}}; |
796 |
+ |
testInvokeOnPool(mainPool(), a); |
797 |
+ |
} |
798 |
+ |
|
799 |
+ |
/** |
800 |
|
* invokeAll(t1, t2) invokes all task arguments |
801 |
|
*/ |
802 |
|
public void testInvokeAll2() { |