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.176 by jsr166, Wed Sep 21 18:21:56 2016 UTC vs.
Revision 1.177 by jsr166, Wed Sep 21 18:25:04 2016 UTC

# Line 4049 | Line 4049 | public class CompletableFutureTest exten
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() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines