jdk Udiff test/java/util/concurrent/CompletableFuture/Basic.java (original) (raw)

Print this page


@@ -502,11 +502,11 @@ check(cf1.isDone() || cf2.isDone());

         cf1 = supplyAsync(() -> { throw new RuntimeException(); });
         cf2 = supplyAsync(() -> 2);
         cf3 = cf1.applyToEither(cf2, (x) -> { check(x == 2); return x; });

@@ -518,10 +518,27 @@ cf1 = supplyAsync(() -> { throw new RuntimeException(); }); cf2 = supplyAsync(() -> { throw new RuntimeException(); }); cf3 = cf1.applyToEitherAsync(cf2, (x) -> { fail(); return x; }); checkCompletedExceptionally(cf3); check(cf1.isDone() || cf2.isDone()); +


@@ -568,10 +585,27 @@ cf1 = supplyAsync(() -> { throw new RuntimeException(); }); cf2 = supplyAsync(() -> { throw new RuntimeException(); }); cf3 = cf2.acceptEitherAsync(cf1, (x) -> { fail(); }); checkCompletedExceptionally(cf3); check(cf1.isDone() || cf2.isDone()); +


@@ -603,31 +637,56 @@

         before = atomicInt.get();
         cf1 = runAsync(() -> { throw new RuntimeException(); });
         cf2 = runAsync(() -> { });
         cf3 = cf2.runAfterEither(cf1, () -> { atomicInt.incrementAndGet(); });