use of com.hazelcast.client.executor.tasks.MapPutRunnable in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnKeyOwner.
@Test
public void testExecuteOnKeyOwner() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
Member member = server1.getCluster().getLocalMember();
final UUID targetUuid = member.getUuid();
String key = generateKeyOwnedBy(server1);
service.executeOnKeyOwner(new MapPutRunnable(mapName), key);
final IMap map = client.getMap(mapName);
assertTrueEventually(() -> assertTrue(map.containsKey(targetUuid)));
}
use of com.hazelcast.client.executor.tasks.MapPutRunnable 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);
}
use of com.hazelcast.client.executor.tasks.MapPutRunnable in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnMember_WhenMemberNull.
@Test(expected = NullPointerException.class)
public void testExecuteOnMember_WhenMemberNull() {
IExecutorService service = client.getExecutorService(randomString());
service.executeOnMember(new MapPutRunnable("map"), null);
}
use of com.hazelcast.client.executor.tasks.MapPutRunnable 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.client.executor.tasks.MapPutRunnable in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnMember.
@Test
public void testExecuteOnMember() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
Member member = server1.getCluster().getLocalMember();
final UUID targetUuid = member.getUuid();
service.executeOnMember(new MapPutRunnable(mapName), member);
final IMap map = client.getMap(mapName);
assertTrueEventually(() -> assertTrue(map.containsKey(targetUuid)));
}
Aggregations