use of com.hazelcast.client.spi.impl.listener.ClientEventRegistration 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.client.spi.impl.listener.ClientEventRegistration 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);
}
use of com.hazelcast.client.spi.impl.listener.ClientEventRegistration in project hazelcast by hazelcast.
the class ListenerLeakTestNonSmartRouting method testSetListeners.
@Test
public void testSetListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = 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 ListenerLeakTestNonSmartRouting method testDistributedObjectListeners.
@Test
public void testDistributedObjectListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = newHazelcastClient();
String id = client.addDistributedObjectListener(mock(DistributedObjectListener.class));
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(client.removeDistributedObjectListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.client.spi.impl.listener.ClientEventRegistration in project hazelcast by hazelcast.
the class ListenerLeakTestNonSmartRouting method testMultiMapEntryListeners.
@Test
public void testMultiMapEntryListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = 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);
}
Aggregations