use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testRemoveListener_whenNotExist.
@Test
public void testRemoveListener_whenNotExist() throws InterruptedException {
final MultiMap mm = client.getMultiMap(randomString());
assertFalse(mm.removeEntryListener(UuidUtil.newUnsecureUUID()));
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testListenerOnKeyEntryRemove_WithOneRemoveWhenValueNotIncluded.
@Test
public void testListenerOnKeyEntryRemove_WithOneRemoveWhenValueNotIncluded() throws InterruptedException {
final Object key = "key";
final int maxItems = 56;
final MultiMap mm = client.getMultiMap(randomString());
MyEntryListener listener = new CountDownValueNullListener(maxItems, 1);
final UUID id = mm.addEntryListener(listener, key, false);
for (int i = 0; i < maxItems; i++) {
mm.put(key, i);
}
mm.remove(key);
assertOpenEventually(listener.removeLatch);
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testListenerEntryRemoveEvent_whenValueNotIncluded.
@Test
public void testListenerEntryRemoveEvent_whenValueNotIncluded() throws InterruptedException {
final int maxKeys = 31;
final int maxItems = 3;
final MultiMap mm = client.getMultiMap(randomString());
MyEntryListener listener = new CountDownValueNullListener(maxKeys * maxItems);
mm.addEntryListener(listener, false);
for (int i = 0; i < maxKeys; i++) {
for (int j = 0; j < maxKeys; j++) {
mm.put(i, j);
mm.remove(i);
}
}
assertOpenEventually(listener.removeLatch);
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testRemoveListener.
@Test
public void testRemoveListener() throws InterruptedException {
final MultiMap mm = client.getMultiMap(randomString());
MyEntryListener listener = new CountDownValueNotNullListener(1);
final UUID id = mm.addEntryListener(listener, true);
assertTrue(mm.removeEntryListener(id));
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testListeners_clearAll.
@Test
public void testListeners_clearAll() {
final MultiMap mm = client.getMultiMap(randomString());
MyEntryListener listener = new CountDownValueNullListener(1);
mm.addEntryListener(listener, false);
mm.put("key", "value");
mm.clear();
assertOpenEventually(listener.addLatch);
assertOpenEventually(listener.clearLatch);
}
Aggregations