use of com.hazelcast.cluster.MemberSelector in project hazelcast by hazelcast.
the class MemberSelectorsTest method testAndMemberSelector.
@Test
public void testAndMemberSelector() {
when(member.localMember()).thenReturn(true);
MemberSelector selector = MemberSelectors.and(LOCAL_MEMBER_SELECTOR, LITE_MEMBER_SELECTOR);
assertFalse(selector.select(member));
verify(member).localMember();
verify(member).isLiteMember();
}
use of com.hazelcast.cluster.MemberSelector in project hazelcast by hazelcast.
the class MemberSelectorsTest method testOrMemberSelector3.
@Test
public void testOrMemberSelector3() {
when(member.localMember()).thenReturn(true);
when(member.isLiteMember()).thenReturn(true);
MemberSelector selector = MemberSelectors.or(LOCAL_MEMBER_SELECTOR, LITE_MEMBER_SELECTOR);
assertTrue(selector.select(member));
verify(member).localMember();
verify(member, never()).isLiteMember();
}
use of com.hazelcast.cluster.MemberSelector in project hazelcast by hazelcast.
the class MemberSelectorsTest method testOrMemberSelector4.
@Test
public void testOrMemberSelector4() {
when(member.isLiteMember()).thenReturn(true);
MemberSelector selector = MemberSelectors.or(LOCAL_MEMBER_SELECTOR, LITE_MEMBER_SELECTOR);
assertTrue(selector.select(member));
verify(member).localMember();
verify(member).isLiteMember();
}
use of com.hazelcast.cluster.MemberSelector in project hazelcast by hazelcast.
the class MemberSelectorsTest method testAndMemberSelector2.
@Test
public void testAndMemberSelector2() {
MemberSelector selector = MemberSelectors.and(LOCAL_MEMBER_SELECTOR, LITE_MEMBER_SELECTOR);
assertFalse(selector.select(member));
verify(member).localMember();
verify(member, never()).isLiteMember();
}
use of com.hazelcast.cluster.MemberSelector 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