use of com.hazelcast.client.executor.tasks.CancellationAwareTask in project hazelcast by hazelcast.
the class ClientExecutorServiceTest method testCancelFutureAfterCancellationAwareTaskTimeOut.
@Test
@Ignore
public //Ignored because fixing it requires extensive refactoring see ClientExecutorServiceCancelTest
void testCancelFutureAfterCancellationAwareTaskTimeOut() throws InterruptedException, ExecutionException, TimeoutException {
IExecutorService service = client.getExecutorService(randomString());
CancellationAwareTask task = new CancellationAwareTask(Long.MAX_VALUE);
Future future = service.submit(task);
try {
future.get(1, TimeUnit.SECONDS);
} catch (TimeoutException ignored) {
}
assertTrue(future.cancel(true));
assertTrue(future.isCancelled());
assertTrue(future.isDone());
}
use of com.hazelcast.client.executor.tasks.CancellationAwareTask in project hazelcast by hazelcast.
the class ClientExecutorServiceTest method testFutureAfterCancellationAwareTaskTimeOut.
@Test
public void testFutureAfterCancellationAwareTaskTimeOut() throws InterruptedException, ExecutionException, TimeoutException {
IExecutorService service = client.getExecutorService(randomString());
CancellationAwareTask task = new CancellationAwareTask(Long.MAX_VALUE);
Future future = service.submit(task);
try {
future.get(1, TimeUnit.SECONDS);
} catch (TimeoutException ignored) {
}
assertFalse(future.isDone());
assertFalse(future.isCancelled());
}
Aggregations