use of com.hazelcast.cp.IAtomicReference in project hazelcast by hazelcast.
the class AbstractAtomicRefBasicTest method test_get_whenRefIsException.
@Test
public void test_get_whenRefIsException() {
IAtomicReference atomicRef = createAtomicRef(randomName());
RuntimeException value = new RuntimeException("boom");
atomicRef.set(value);
assertInstanceOf(RuntimeException.class, atomicRef.get());
assertEquals(value.getMessage(), ((RuntimeException) atomicRef.get()).getMessage());
}
use of com.hazelcast.cp.IAtomicReference in project hazelcast by hazelcast.
the class AbstractAtomicRefBasicTest method test_getAsync_whenRefIsException.
@Test
public void test_getAsync_whenRefIsException() throws ExecutionException, InterruptedException {
IAtomicReference atomicRef = createAtomicRef(randomName());
RuntimeException value = new RuntimeException("boom");
atomicRef.set(value);
assertInstanceOf(RuntimeException.class, atomicRef.getAsync().toCompletableFuture().get());
assertEquals(value.getMessage(), ((RuntimeException) atomicRef.getAsync().toCompletableFuture().get()).getMessage());
}
Aggregations