use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method thenCombineAsync_onIncompleteFuture_whenExecutionRejected.
@Test
public void thenCombineAsync_onIncompleteFuture_whenExecutionRejected() {
CompletableFuture<Object> future = newCompletableFuture(false, 1000L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(RejectedExecutionException.class));
future.thenCombineAsync(newCompletedFuture(null), (v, u) -> null, REJECTING_EXECUTOR).join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method applyToEitherAsync_onIncompleteFuture_whenExecutionRejected.
@Test
public void applyToEitherAsync_onIncompleteFuture_whenExecutionRejected() {
CompletableFuture<Object> future = newCompletableFuture(false, 1000L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(RejectedExecutionException.class));
future.applyToEitherAsync(newCompletedFuture(null), v -> null, REJECTING_EXECUTOR).join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method thenCompose_whenExceptionFromFirstStage.
@Test
public void thenCompose_whenExceptionFromFirstStage() {
CompletableFuture<Object> future = newCompletableFuture(true, 0L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(ExpectedRuntimeException.class));
future.thenCompose(v -> null).join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method thenComposeAsync_whenExecutionRejected.
@Test
public void thenComposeAsync_whenExecutionRejected() {
CompletableFuture<Object> future = newCompletableFuture(false, 0L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(RejectedExecutionException.class));
future.thenComposeAsync(v -> newCompletedFuture(null), REJECTING_EXECUTOR).join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method runAfterEitherAsync_onIncompleteFuture_whenExecutionRejected.
@Test
public void runAfterEitherAsync_onIncompleteFuture_whenExecutionRejected() {
CompletableFuture<Object> future = newCompletableFuture(false, 1000L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(RejectedExecutionException.class));
future.runAfterEitherAsync(newCompletedFuture(null), () -> ignore(), REJECTING_EXECUTOR).join();
}
Aggregations