use of com.hazelcast.client.spi.impl.listener.ClientEventRegistration in project hazelcast by hazelcast.
the class ListenerLeakTestNonSmartRouting method testTopicMessageListener.
@Test
public void testTopicMessageListener() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
ITopic<Object> topic = client.getTopic(randomString());
String id = topic.addMessageListener(mock(MessageListener.class));
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(topic.removeMessageListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.client.spi.impl.listener.ClientEventRegistration in project hazelcast by hazelcast.
the class ListenerLeakTestNonSmartRouting method testMapPartitionLostListeners.
@Test
public void testMapPartitionLostListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
IMap map = client.getMap(randomString());
String id = map.addPartitionLostListener(mock(MapPartitionLostListener.class));
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(map.removePartitionLostListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.client.spi.impl.listener.ClientEventRegistration in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testSetListeners.
@Test
public void testSetListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
ISet<Object> set = client.getSet(randomString());
String id = set.addItemListener(mock(ItemListener.class), false);
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(set.removeItemListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.client.spi.impl.listener.ClientEventRegistration 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.client.spi.impl.listener.ClientEventRegistration 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);
}
Aggregations