use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class ClientInvocationFutureTest method test_interruptionDuringJoin.
@Test
public void test_interruptionDuringJoin() {
Thread thisThread = Thread.currentThread();
Thread t = new Thread(() -> {
sleepSeconds(2);
thisThread.interrupt();
});
t.start();
expected.expect(CompletionException.class);
expected.expectCause(new RootCauseMatcher(InterruptedException.class));
invocationFuture.join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class ClientDelegatingFutureTest method get_whenCompletedExceptionally.
@Test
public void get_whenCompletedExceptionally() throws Exception {
invocationFuture.completeExceptionally(new IllegalArgumentException());
assertTrue(delegatingFuture.isDone());
assertTrue(delegatingFuture.isCompletedExceptionally());
expected.expect(ExecutionException.class);
expected.expectCause(new RootCauseMatcher(IllegalArgumentException.class));
delegatingFuture.get();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class ClientDurableExecutorServiceTest method test_whenRingBufferIsFull_thenThrowRejectedExecutionException.
@Test
public void test_whenRingBufferIsFull_thenThrowRejectedExecutionException() throws Exception {
String key = randomString();
DurableExecutorService service = client.getDurableExecutorService(SINGLE_TASK + randomString());
service.submitToKeyOwner(new SleepingTask(100), key);
DurableExecutorServiceFuture<String> future = service.submitToKeyOwner(new BasicTestCallable(), key);
expectedException.expect(new RootCauseMatcher(RejectedExecutionException.class));
future.get();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class ClientDurableExecutorServiceTest method testSubmitFailingCallableReasonExceptionCause.
@Test
public void testSubmitFailingCallableReasonExceptionCause() throws Exception {
DurableExecutorService service = client.getDurableExecutorService(randomString());
Future<String> future = service.submit(new FailingCallable());
expectedException.expect(new RootCauseMatcher(IllegalStateException.class));
future.get();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class ClientInvocationFutureTest method test_exceptionalCompletion_withGet.
@Test
public void test_exceptionalCompletion_withGet() throws ExecutionException, InterruptedException {
invocationFuture.completeExceptionally(new IllegalArgumentException());
assertTrue(invocationFuture.isDone());
assertFalse(invocationFuture.isCancelled());
assertTrue(invocationFuture.isCompletedExceptionally());
expected.expect(ExecutionException.class);
expected.expectCause(new RootCauseMatcher(IllegalArgumentException.class));
invocationFuture.get();
}
Aggregations