ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CompletableFutureTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CompletableFutureTest.java (file contents):
Revision 1.174 by jsr166, Wed Sep 21 18:01:06 2016 UTC vs.
Revision 1.175 by jsr166, Wed Sep 21 18:07:37 2016 UTC

# Line 4058 | Line 4058 | public class CompletableFutureTest exten
4058          checkCompletedNormally(minimal.toCompletableFuture(), v1);
4059      }}
4060  
4061 +    /**
4062 +     * Completion of a toCompletableFuture copy of a minimal stage
4063 +     * does not complete its source.
4064 +     */
4065 +    public void testMinimalCompletionStage_toCompletableFuture_oneWayPropagation() {
4066 +        CompletableFuture<Integer> f = new CompletableFuture<>();
4067 +        CompletionStage<Integer> g = f.minimalCompletionStage();
4068 +        assertTrue(g.toCompletableFuture().complete(1));
4069 +        assertTrue(g.toCompletableFuture().complete(null));
4070 +        assertTrue(g.toCompletableFuture().cancel(true));
4071 +        assertTrue(g.toCompletableFuture().cancel(false));
4072 +        assertTrue(g.toCompletableFuture().completeExceptionally(new CFException()));
4073 +        checkIncomplete(g.toCompletableFuture());
4074 +        f.complete(1);
4075 +        checkCompletedNormally(g.toCompletableFuture(), 1);
4076 +    }
4077 +
4078      /** Demo utility method for external reliable toCompletableFuture */
4079      static <T> CompletableFuture<T> toCompletableFuture(CompletionStage<T> stage) {
4080          CompletableFuture<T> f = new CompletableFuture<>();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines