use of com.hazelcast.client.executor.tasks.MapPutRunnable in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnMembers.
@Test
public void testExecuteOnMembers() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
Collection<Member> collection = new ArrayList<Member>();
final Member member1 = server1.getCluster().getLocalMember();
final Member member2 = server2.getCluster().getLocalMember();
collection.add(member1);
collection.add(member2);
service.executeOnMembers(new MapPutRunnable(mapName), collection);
final IMap map = client.getMap(mapName);
assertTrueEventually(() -> {
assertTrue(map.containsKey(member1.getUuid()));
assertTrue(map.containsKey(member2.getUuid()));
});
}
use of com.hazelcast.client.executor.tasks.MapPutRunnable in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnMembers_whenSelectorNull.
@Test(expected = NullPointerException.class)
public void testExecuteOnMembers_whenSelectorNull() {
IExecutorService service = client.getExecutorService(randomString());
MemberSelector selector = null;
service.executeOnMembers(new MapPutRunnable("task"), selector);
}
use of com.hazelcast.client.executor.tasks.MapPutRunnable in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnMembers_WhenCollectionNull.
@Test(expected = NullPointerException.class)
public void testExecuteOnMembers_WhenCollectionNull() {
IExecutorService service = client.getExecutorService(randomString());
Collection<Member> collection = null;
service.executeOnMembers(new MapPutRunnable("task"), collection);
}
use of com.hazelcast.client.executor.tasks.MapPutRunnable in project hazelcast by hazelcast.
the class ClientExecutorServiceTest method testExecute_withNoMemberSelected.
@Test(expected = RejectedExecutionException.class)
public void testExecute_withNoMemberSelected() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
MemberSelector selector = new SelectNoMembers();
service.execute(new MapPutRunnable(mapName), selector);
}
Aggregations