use of com.hazelcast.core.IExecutorService in project hazelcast by hazelcast.
the class ClientExecutorServiceTest method testCancellationAwareTask_whenTimeOut.
@Test(expected = TimeoutException.class)
public void testCancellationAwareTask_whenTimeOut() throws InterruptedException, ExecutionException, TimeoutException {
IExecutorService service = client.getExecutorService(randomString());
CancellationAwareTask task = new CancellationAwareTask(Long.MAX_VALUE);
Future future = service.submit(task);
future.get(1, TimeUnit.SECONDS);
}
use of com.hazelcast.core.IExecutorService in project hazelcast by hazelcast.
the class ClientExecutorServiceTest method testShutdownNow.
@Test
public void testShutdownNow() throws InterruptedException, ExecutionException, TimeoutException {
final IExecutorService service = client.getExecutorService(randomString());
service.shutdownNow();
assertTrueEventually(new AssertTask() {
public void run() throws Exception {
assertTrue(service.isShutdown());
}
});
}
use of com.hazelcast.core.IExecutorService in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecute_withMemberSelector.
@Test
public void testExecute_withMemberSelector() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
MemberSelector selector = new SelectAllMembers();
service.execute(new MapPutRunnable(mapName), selector);
IMap map = client.getMap(mapName);
assertSizeEventually(1, map);
}
use of com.hazelcast.core.IExecutorService in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnKeyOwner_whenKeyNull.
@Test(expected = NullPointerException.class)
public void testExecuteOnKeyOwner_whenKeyNull() {
IExecutorService service = client.getExecutorService(randomString());
service.executeOnKeyOwner(new MapPutRunnable("map"), null);
}
use of com.hazelcast.core.IExecutorService in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnMembers_withSelector.
@Test
public void testExecuteOnMembers_withSelector() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
MemberSelector selector = new SelectAllMembers();
service.executeOnMembers(new MapPutRunnable(mapName), selector);
IMap map = client.getMap(mapName);
assertSizeEventually(CLUSTER_SIZE, map);
}
Aggregations