use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class ListenerLeakTest method testListenerLeakOnMember_whenClientDestroyed.
@Test
public void testListenerLeakOnMember_whenClientDestroyed() {
Collection<Node> nodes = createNodes();
for (int i = 0; i < 100; i++) {
newHazelcastClient().shutdown();
}
assertTrueEventually(() -> {
for (Node node : nodes) {
assertEquals(0, node.getClientEngine().getClusterListenerService().getClusterListeningEndpoints().size());
}
});
}
use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class ListenerLeakTest method testReplicatedMapListeners.
@Test
public void testReplicatedMapListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
ReplicatedMap<Object, Object> replicatedMap = client.getReplicatedMap(randomString());
UUID id = replicatedMap.addEntryListener(mock(EntryListener.class));
Collection<ClientConnectionRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(replicatedMap.removeEntryListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class ListenerLeakTest method testQueueListeners.
@Test
public void testQueueListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
IQueue<Object> queue = client.getQueue(randomString());
UUID id = queue.addItemListener(mock(ItemListener.class), false);
Collection<ClientConnectionRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(queue.removeItemListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class ListenerLeakTest method testSetListeners.
@Test
public void testSetListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
ISet<Object> set = client.getSet(randomString());
UUID id = set.addItemListener(mock(ItemListener.class), false);
Collection<ClientConnectionRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(set.removeItemListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.instance.impl.Node in project hazelcast by hazelcast.
the class MapInfoCollector method initMapConfigs.
private void initMapConfigs(Node node) {
Collection<DistributedObject> objects = node.hazelcastInstance.getDistributedObjects();
mapConfigs = new HashMap<>();
objects.stream().filter(obj -> obj.getServiceName().equals(MapService.SERVICE_NAME)).forEach(obj -> {
MapConfig config = node.getConfig().findMapConfig(obj.getName());
if (config != null) {
mapConfigs.put(obj.getName(), config);
}
});
}
Aggregations