use of com.hazelcast.test.ExpectedRuntimeException in project hazelcast by hazelcast.
the class AbstractInvocationFuture_MiscTest method obtrudeException_whenComplete.
@Test
public void obtrudeException_whenComplete() {
future.complete(value);
future.obtrudeException(new ExpectedRuntimeException());
try {
future.joinInternal();
fail();
} catch (ExpectedRuntimeException e) {
ignore(e);
}
}
use of com.hazelcast.test.ExpectedRuntimeException in project hazelcast by hazelcast.
the class AbstractInvocationFuture_MiscTest method obtrudeException_whenNotComplete.
@Test
public void obtrudeException_whenNotComplete() {
future.obtrudeException(new ExpectedRuntimeException());
try {
future.joinInternal();
fail();
} catch (ExpectedRuntimeException e) {
ignore(e);
}
}
use of com.hazelcast.test.ExpectedRuntimeException 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.test.ExpectedRuntimeException in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method thenCombine_whenActionThrowsException.
@Test
public void thenCombine_whenActionThrowsException() {
CompletableFuture<Object> future = newCompletableFuture(false, 1000L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(ExpectedRuntimeException.class));
future.thenCombine(newCompletedFuture(null), (t, u) -> {
throw new ExpectedRuntimeException();
}).join();
}
use of com.hazelcast.test.ExpectedRuntimeException in project hazelcast by hazelcast.
the class CompletableFutureAbstractTest method thenAcceptBoth_whenActionThrowsException.
@Test
public void thenAcceptBoth_whenActionThrowsException() {
CompletableFuture<Object> future = newCompletableFuture(false, 1000L);
expectedException.expect(CompletionException.class);
expectedException.expectCause(new RootCauseMatcher(ExpectedRuntimeException.class));
future.thenAcceptBoth(newCompletedFuture(null), (v, u) -> {
throw new ExpectedRuntimeException();
}).join();
}
Aggregations