Available Methods
- completedFuture ( )
- get ( )
- complete ( )
- completeExceptionally ( )
- supplyAsync ( )
- whenComplete ( )
- runAsync ( )
- join ( )
- thenApply ( )
- allOf ( )
- isDone ( )
- thenCompose ( )
- cancel ( )
- thenAccept ( )
- whenCompleteAsync ( )
- failedFuture ( )
- exceptionally ( )
- thenRun ( )
- anyOf ( )
- handle ( )
- isCompletedExceptionally ( )
- thenApplyAsync ( )
- thenCombine ( )
- thenAcceptAsync ( )
- thenComposeAsync ( )
- handleAsync ( )
- getNow ( )
- thenRunAsync ( )
- isCancelled ( )
- minimalCompletionStage ( )
- thenAcceptBoth ( )
- runAfterEitherAsync ( )
- acceptEitherAsync ( )
- completeAsync ( )
- thenAcceptBothAsync ( )
- runAfterBothAsync ( )
- applyToEither ( )
- delayedExecutor ( )
- orTimeout ( )
- failedStage ( )
- obtrudeException ( )
- runAfterBoth ( )
- obtrudeValue ( )
- applyToEitherAsync ( )
- thenCombineAsync ( )
Related Classes
- java.util.Arrays
- java.io.File
- java.util.Collections
- java.util.concurrent.TimeUnit
- java.util.UUID
- java.util.stream.Collectors
- java.util.concurrent.Executors
- java.util.Objects
- java.net.URI
- java.util.concurrent.ExecutorService
- java.util.concurrent.atomic.AtomicInteger
- org.junit.Assert
- java.util.Optional
- java.util.concurrent.ExecutionException
- java.util.concurrent.atomic.AtomicBoolean
- java.nio.file.Path
- java.util.stream.Stream
- java.util.function.Function
- java.util.concurrent.Future
- java.util.concurrent.CountDownLatch
- java.util.function.Consumer
- com.google.common.collect.Lists
- java.util.function.Supplier
- org.mockito.Mockito
- java.util.concurrent.atomic.AtomicReference
Java Code Examples for java.util.concurrent.CompletableFuture#failedStage()
The following examples show how to use
java.util.concurrent.CompletableFuture#failedStage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompletableFutureTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * failedStage returns a CompletionStage completed * exceptionally with the given Exception */ public void testFailedStage() { CFException ex = new CFException(); CompletionStage<Integer> f = CompletableFuture.failedStage(ex); AtomicInteger x = new AtomicInteger(0); AtomicReference<Throwable> r = new AtomicReference<>(); f.whenComplete((v, e) -> {if (e != null) r.set(e); else x.set(v);}); assertEquals(x.get(), 0); assertEquals(r.get(), ex); }
Example 2
Source File: CompletableFutureTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * failedStage returns a CompletionStage completed * exceptionally with the given Exception */ public void testFailedStage() { CFException ex = new CFException(); CompletionStage<Integer> f = CompletableFuture.failedStage(ex); AtomicInteger x = new AtomicInteger(0); AtomicReference<Throwable> r = new AtomicReference<Throwable>(); f.whenComplete((v, e) -> {if (e != null) r.set(e); else x.set(v);}); assertEquals(x.get(), 0); assertEquals(r.get(), ex); }