use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testMapEntryListeners.
@Test
public void testMapEntryListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
IMap map = client.getMap(randomString());
String id = map.addEntryListener(mock(MapListener.class), false);
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(map.removeEntryListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testReplicatedMapListeners.
@Test
public void testReplicatedMapListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
ReplicatedMap<Object, Object> replicatedMap = client.getReplicatedMap(randomString());
String id = replicatedMap.addEntryListener(mock(EntryListener.class));
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(replicatedMap.removeEntryListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testMultiMapEntryListeners.
@Test
public void testMultiMapEntryListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
MultiMap multiMap = client.getMultiMap(randomString());
String id = multiMap.addEntryListener(mock(EntryListener.class), false);
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(multiMap.removeEntryListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSupport method createNodes.
protected Collection<Node> createNodes() {
int NODE_COUNT = 3;
Collection<Node> nodes = new ArrayList<Node>(3);
for (int i = 0; i < NODE_COUNT; i++) {
HazelcastInstance hazelcast = hazelcastFactory.newHazelcastInstance();
nodes.add(getNode(hazelcast));
}
return nodes;
}
use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestNonSmartRouting method testMapEntryListeners.
@Test
public void testMapEntryListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
IMap map = client.getMap(randomString());
String id = map.addEntryListener(mock(MapListener.class), false);
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(map.removeEntryListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
Aggregations