use of com.hazelcast.client.impl.spi.impl.listener.ClientConnectionRegistration in project hazelcast by hazelcast.
the class ListenerLeakTest method testListListeners.
@Test
public void testListListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
IList<Object> list = client.getList(randomString());
UUID id = list.addItemListener(mock(ItemListener.class), false);
Collection<ClientConnectionRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(list.removeItemListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.client.impl.spi.impl.listener.ClientConnectionRegistration in project hazelcast by hazelcast.
the class ListenerLeakTest method testMultiMapEntryListeners.
@Test
public void testMultiMapEntryListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
MultiMap multiMap = client.getMultiMap(randomString());
UUID id = multiMap.addEntryListener(mock(EntryListener.class), false);
Collection<ClientConnectionRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(multiMap.removeEntryListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.client.impl.spi.impl.listener.ClientConnectionRegistration 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.client.impl.spi.impl.listener.ClientConnectionRegistration 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.client.impl.spi.impl.listener.ClientConnectionRegistration 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);
}
Aggregations