use of com.hazelcast.durableexecutor.DurableExecutorService in project hazelcast by hazelcast.
the class ClientDurableExecutorServiceTest method testIsTerminated.
@Test
public void testIsTerminated() {
DurableExecutorService service = client.getDurableExecutorService(randomString());
assertFalse(service.isTerminated());
}
use of com.hazelcast.durableexecutor.DurableExecutorService in project hazelcast by hazelcast.
the class ClientDurableRetrieveResultTest method testRetrieve_WhenSubmitterMemberDown.
@Test
public void testRetrieve_WhenSubmitterMemberDown() throws Exception {
String name = randomString();
DurableExecutorService executorService = client.getDurableExecutorService(name);
SleepingTask task = new SleepingTask(4);
long taskId = executorService.submit(task).getTaskId();
client.shutdown();
client = hazelcastFactory.newHazelcastClient();
executorService = client.getDurableExecutorService(name);
Future<Boolean> future = executorService.retrieveResult(taskId);
assertTrue(future.get());
}
use of com.hazelcast.durableexecutor.DurableExecutorService in project hazelcast by hazelcast.
the class ClientDurableRetrieveResultTest method testRetrieveAndDispose_WhenOwnerMemberDown.
@Test
public void testRetrieveAndDispose_WhenOwnerMemberDown() throws Exception {
String name = randomString();
String key = generateKeyOwnedBy(instance2);
DurableExecutorService executorService = client.getDurableExecutorService(name);
SleepingTask task = new SleepingTask(4);
long taskId = executorService.submitToKeyOwner(task, key).getTaskId();
instance2.shutdown();
Future<Boolean> future = executorService.retrieveAndDisposeResult(taskId);
assertTrue(future.get());
Future<Boolean> resultFuture = executorService.retrieveResult(taskId);
assertNull(resultFuture.get());
}
use of com.hazelcast.durableexecutor.DurableExecutorService in project hazelcast by hazelcast.
the class ClientDurableRetrieveResultTest method testRetrieveAndDispose_WhenClientDown.
@Test
public void testRetrieveAndDispose_WhenClientDown() throws Exception {
String name = randomString();
DurableExecutorService executorService = client.getDurableExecutorService(name);
SleepingTask task = new SleepingTask(4);
long taskId = executorService.submit(task).getTaskId();
client.shutdown();
client = hazelcastFactory.newHazelcastClient();
executorService = client.getDurableExecutorService(name);
Future<Boolean> future = executorService.retrieveAndDisposeResult(taskId);
assertTrue(future.get());
Future<Object> resultFuture = executorService.retrieveResult(taskId);
assertNull(resultFuture.get());
}
use of com.hazelcast.durableexecutor.DurableExecutorService in project hazelcast by hazelcast.
the class ClientDurableRetrieveResultTest method testRetrieve_WhenOwnerMemberDown.
@Test
public void testRetrieve_WhenOwnerMemberDown() throws Exception {
String name = randomString();
String key = generateKeyOwnedBy(instance2);
DurableExecutorService executorService = client.getDurableExecutorService(name);
SleepingTask task = new SleepingTask(4);
long taskId = executorService.submitToKeyOwner(task, key).getTaskId();
instance2.shutdown();
Future<Boolean> future = executorService.retrieveResult(taskId);
assertTrue(future.get());
}
Aggregations