use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testListenerOnKeyEntryAddEvent.
@Test
public void testListenerOnKeyEntryAddEvent() throws InterruptedException {
final Object key = "key";
final int maxItems = 42;
final MultiMap mm = client.getMultiMap(randomString());
MyEntryListener listener = new CountDownValueNotNullListener(maxItems);
mm.addEntryListener(listener, key, true);
for (int i = 0; i < maxItems; i++) {
mm.put(key, i);
}
assertOpenEventually(listener.addLatch);
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testListenerOnKeyEntryAddEvent_whenValueNotIncluded.
@Test
public void testListenerOnKeyEntryAddEvent_whenValueNotIncluded() throws InterruptedException {
final Object key = "key";
final int maxItems = 72;
final MultiMap mm = client.getMultiMap(randomString());
MyEntryListener listener = new CountDownValueNullListener(maxItems);
mm.addEntryListener(listener, key, false);
for (int i = 0; i < maxItems; i++) {
mm.put(key, i);
}
assertOpenEventually(listener.addLatch);
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testAddLocalEntryListener_whenValueIncluded.
@Test(expected = UnsupportedOperationException.class)
public void testAddLocalEntryListener_whenValueIncluded() {
final MultiMap mm = client.getMultiMap(randomString());
MyEntryListener myEntryListener = new CountDownValueNotNullListener(1);
mm.addLocalEntryListener(myEntryListener, true);
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testAddListener_whenListenerNull.
@Test(expected = NullPointerException.class)
public void testAddListener_whenListenerNull() throws InterruptedException {
final MultiMap mm = client.getMultiMap(randomString());
mm.addEntryListener(null, true);
}
use of com.hazelcast.multimap.MultiMap in project hazelcast by hazelcast.
the class ClientMultiMapListenersTest method testAddLocalEntryListener_whenNull.
@Test(expected = UnsupportedOperationException.class)
public void testAddLocalEntryListener_whenNull() {
final MultiMap mm = client.getMultiMap(randomString());
mm.addLocalEntryListener(null);
}
Aggregations