use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testTopicMessageListener.
@Test
public void testTopicMessageListener() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.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.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testDistributedObjectListeners.
@Test
public void testDistributedObjectListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.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.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testMapPartitionLostListeners.
@Test
public void testMapPartitionLostListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.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.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testListListeners.
@Test
public void testListListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
IList<Object> list = client.getList(randomString());
String id = list.addItemListener(mock(ItemListener.class), false);
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(list.removeItemListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class ListenerLeakTestSmartRouting method testQueueListeners.
@Test
public void testQueueListeners() {
Collection<Node> nodes = createNodes();
HazelcastInstance client = hazelcastFactory.newHazelcastClient();
IQueue<Object> queue = client.getQueue(randomString());
String id = queue.addItemListener(mock(ItemListener.class), false);
Collection<ClientEventRegistration> registrations = getClientEventRegistrations(client, id);
assertTrue(queue.removeItemListener(id));
assertNoLeftOver(nodes, client, id, registrations);
}
Aggregations