use of com.hazelcast.client.spi.ProxyManager in project hazelcast by hazelcast.
the class ProxyManagerTest method testNextAddressToSendCreateRequestOnMultipleLiteMembers.
@Test
public void testNextAddressToSendCreateRequestOnMultipleLiteMembers() {
final List<HazelcastInstance> instances = createNodes(3, 0);
final HazelcastInstance client = factory.newHazelcastClient();
final HazelcastClientInstanceImpl clientInstanceImpl = getHazelcastClientInstanceImpl(client);
Set<Address> addresses = new HashSet<Address>();
final ProxyManager proxyManager = clientInstanceImpl.getProxyManager();
for (int i = 0; i < instances.size() * 100; i++) {
addresses.add(proxyManager.findNextAddressToSendCreateRequest());
}
assertEquals(1, addresses.size());
}
use of com.hazelcast.client.spi.ProxyManager in project hazelcast by hazelcast.
the class ProxyManagerTest method testNextAddressToSendCreateRequestOnMultipleDataMembers.
@Test
public void testNextAddressToSendCreateRequestOnMultipleDataMembers() {
final List<HazelcastInstance> instances = createNodes(3, 3);
final HazelcastInstance client = factory.newHazelcastClient();
final HazelcastClientInstanceImpl clientInstanceImpl = getHazelcastClientInstanceImpl(client);
Set<Address> addresses = new HashSet<Address>();
final ProxyManager proxyManager = clientInstanceImpl.getProxyManager();
for (int i = 0; i < instances.size() * 100; i++) {
addresses.add(proxyManager.findNextAddressToSendCreateRequest());
}
assertEquals(3, addresses.size());
for (HazelcastInstance lite : instances.subList(3, 6)) {
assertContains(addresses, getAddress(lite));
}
}
use of com.hazelcast.client.spi.ProxyManager in project hazelcast by hazelcast.
the class ProxyManagerTest method testNextAddressToSendCreateRequestOnSingleDataMember.
@Test
public void testNextAddressToSendCreateRequestOnSingleDataMember() {
final List<HazelcastInstance> instances = createNodes(3, 1);
final Address dataInstanceAddress = getAddress(instances.get(3));
final HazelcastInstance client = factory.newHazelcastClient();
final HazelcastClientInstanceImpl clientInstanceImpl = getHazelcastClientInstanceImpl(client);
final ProxyManager proxyManager = clientInstanceImpl.getProxyManager();
for (int i = 0; i < instances.size(); i++) {
assertEquals(dataInstanceAddress, proxyManager.findNextAddressToSendCreateRequest());
}
}
Aggregations