use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method thenCombineAsync_whenExecutionRejected.
@Test
public void thenCombineAsync_whenExecutionRejected() {
CompletableFuture<Object> future = newCompletableFuture(false, 0L);
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 thenApply_exceptional.
@Test
public void thenApply_exceptional() {
CompletableFuture<Object> future = newCompletableFuture(true, 0L);
CompletableFuture<Object> chained = future.thenApply(Function.identity());
assertTrueEventually(() -> assertTrue(chained.isDone()));
assertTrue(chained.isCompletedExceptionally());
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(ExpectedRuntimeException.class));
chained.join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method runAfterBoth_whenActionThrowsException.
@Test
public void runAfterBoth_whenActionThrowsException() {
CompletableFuture<Object> future = newCompletableFuture(false, 1000L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(ExpectedRuntimeException.class));
future.runAfterBoth(newCompletedFuture(null), () -> {
throw new ExpectedRuntimeException();
}).join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method runAfterBothAsync_whenExecutionRejected.
@Test
public void runAfterBothAsync_whenExecutionRejected() {
CompletableFuture<Object> future = newCompletableFuture(false, 0L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(RejectedExecutionException.class));
future.runAfterBothAsync(newCompletedFuture(null), () -> ignore(), REJECTING_EXECUTOR).join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method thenAcceptBothAsync_whenExecutionRejected.
@Test
public void thenAcceptBothAsync_whenExecutionRejected() {
CompletableFuture<Object> future = newCompletableFuture(false, 0L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(RejectedExecutionException.class));
future.thenAcceptBothAsync(newCompletedFuture(null), (v, u) -> ignore(), REJECTING_EXECUTOR).join();
}
Aggregations