4049 |
|
}} |
4050 |
|
|
4051 |
|
/** |
4052 |
+ |
* minimalStage.toCompletableFuture() returns a CompletableFuture that |
4053 |
+ |
* is completed exceptionally when source is. |
4054 |
+ |
*/ |
4055 |
+ |
public void testMinimalCompletionStage_toCompletableFuture_exceptionalCompletion() { |
4056 |
+ |
for (boolean createIncomplete : new boolean[] { true, false }) |
4057 |
+ |
{ |
4058 |
+ |
CFException ex = new CFException(); |
4059 |
+ |
CompletableFuture<Integer> f = new CompletableFuture<>(); |
4060 |
+ |
CompletionStage<Integer> minimal = f.minimalCompletionStage(); |
4061 |
+ |
if (!createIncomplete) f.completeExceptionally(ex); |
4062 |
+ |
CompletableFuture<Integer> g = minimal.toCompletableFuture(); |
4063 |
+ |
if (createIncomplete) { |
4064 |
+ |
checkIncomplete(f); |
4065 |
+ |
checkIncomplete(g); |
4066 |
+ |
f.completeExceptionally(ex); |
4067 |
+ |
} |
4068 |
+ |
checkCompletedExceptionally(f, ex); |
4069 |
+ |
checkCompletedWithWrappedException(g, ex); |
4070 |
+ |
}} |
4071 |
+ |
|
4072 |
+ |
/** |
4073 |
|
* minimalStage.toCompletableFuture() gives mutable CompletableFuture |
4074 |
|
*/ |
4075 |
|
public void testMinimalCompletionStage_toCompletableFuture_mutable() { |