use of com.hazelcast.core.ICompletableFuture in project hazelcast by hazelcast.
the class DelegatingFutureTest method test_andThen_Exception.
@Test(expected = RuntimeException.class)
public void test_andThen_Exception() {
Throwable error = new RuntimeException();
ICompletableFuture future = new DelegatingFuture(new FakeCompletableFuture(error), null);
TestExecutionCallback callback = new TestExecutionCallback();
future.andThen(callback, new CallerRunsExecutor());
}
use of com.hazelcast.core.ICompletableFuture in project hazelcast by hazelcast.
the class CompletedFutureTest method test_andThen_Exception.
@Test(expected = RuntimeException.class)
public void test_andThen_Exception() {
Throwable error = new RuntimeException();
ICompletableFuture future = new CompletedFuture(null, error, null);
TestExecutionCallback callback = new TestExecutionCallback();
future.andThen(callback, new CallerRunsExecutor());
}
use of com.hazelcast.core.ICompletableFuture in project hazelcast by hazelcast.
the class CompletedFutureTest method test_andThen_Object.
@Test
public void test_andThen_Object() {
Object value = "value";
ICompletableFuture future = new CompletedFuture(null, value, null);
TestExecutionCallback callback = new TestExecutionCallback();
future.andThen(callback, new CallerRunsExecutor());
assertEquals(value, callback.value);
}
use of com.hazelcast.core.ICompletableFuture in project hazelcast by hazelcast.
the class CompletedFutureTest method test_andThen_Exception_Data.
@Test(expected = RuntimeException.class)
public void test_andThen_Exception_Data() {
Throwable error = new RuntimeException();
Data data = serializationService.toData(error);
ICompletableFuture future = new CompletedFuture(serializationService, data, null);
TestExecutionCallback callback = new TestExecutionCallback();
future.andThen(callback, new CallerRunsExecutor());
}
use of com.hazelcast.core.ICompletableFuture in project hazelcast by hazelcast.
the class DelegatingFutureTest method test_andThen_Data.
@Test
public void test_andThen_Data() {
Object value = "value";
Data data = serializationService.toData(value);
ICompletableFuture future = new DelegatingFuture(new FakeCompletableFuture(data), serializationService);
TestExecutionCallback callback = new TestExecutionCallback();
future.andThen(callback, new CallerRunsExecutor());
assertEquals(value, callback.value);
}
Aggregations