--- jsr166/src/test/tck/CompletableFutureTest.java 2016/09/21 18:21:56 1.176 +++ jsr166/src/test/tck/CompletableFutureTest.java 2016/09/21 18:25:04 1.177 @@ -4049,6 +4049,27 @@ public class CompletableFutureTest exten }} /** + * minimalStage.toCompletableFuture() returns a CompletableFuture that + * is completed exceptionally when source is. + */ + public void testMinimalCompletionStage_toCompletableFuture_exceptionalCompletion() { + for (boolean createIncomplete : new boolean[] { true, false }) + { + CFException ex = new CFException(); + CompletableFuture f = new CompletableFuture<>(); + CompletionStage minimal = f.minimalCompletionStage(); + if (!createIncomplete) f.completeExceptionally(ex); + CompletableFuture g = minimal.toCompletableFuture(); + if (createIncomplete) { + checkIncomplete(f); + checkIncomplete(g); + f.completeExceptionally(ex); + } + checkCompletedExceptionally(f, ex); + checkCompletedWithWrappedException(g, ex); + }} + + /** * minimalStage.toCompletableFuture() gives mutable CompletableFuture */ public void testMinimalCompletionStage_toCompletableFuture_mutable() {