Search in sources :

Example 1 with ExceptionThrowingCallable

use of com.hazelcast.test.ExceptionThrowingCallable in project hazelcast by hazelcast.

the class OperationServiceImpl_invokeOnTargetTest method whenExceptionThrownInOperationRun.

@Test
public void whenExceptionThrownInOperationRun() {
    DummyOperation operation = new DummyOperation(new ExceptionThrowingCallable());
    InternalCompletableFuture<String> invocation = operationService.invokeOnTarget(null, operation, getAddress(remote));
    try {
        invocation.joinInternal();
        fail();
    } catch (ExpectedRuntimeException expected) {
    }
}
Also used : ExceptionThrowingCallable(com.hazelcast.test.ExceptionThrowingCallable) ExpectedRuntimeException(com.hazelcast.test.ExpectedRuntimeException) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 2 with ExceptionThrowingCallable

use of com.hazelcast.test.ExceptionThrowingCallable in project hazelcast by hazelcast.

the class OperationServiceImpl_invokeOnPartitionTest method whenExceptionThrownInOperationRun.

@Test
public void whenExceptionThrownInOperationRun() {
    DummyOperation operation = new DummyOperation(new ExceptionThrowingCallable());
    InternalCompletableFuture<String> invocation = operationService.invokeOnPartition(null, operation, getPartitionId(remote));
    try {
        invocation.joinInternal();
        fail();
    } catch (ExpectedRuntimeException expected) {
    }
}
Also used : ExceptionThrowingCallable(com.hazelcast.test.ExceptionThrowingCallable) ExpectedRuntimeException(com.hazelcast.test.ExpectedRuntimeException) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

ExceptionThrowingCallable (com.hazelcast.test.ExceptionThrowingCallable)2 ExpectedRuntimeException (com.hazelcast.test.ExpectedRuntimeException)2 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2 Test (org.junit.Test)2