Package com.hazelcast.core

Examples of com.hazelcast.core.MultiMap


    @Test
    public void testListenerEntryAddEvent() throws InterruptedException {
        final int maxKeys = 12;
        final int maxItems = 3;
        final MultiMap mm = client.getMultiMap(randomString());

        MyEntryListener listener = new CountDownValueNotNullListener(maxKeys * maxItems);
        mm.addEntryListener(listener, true);

        for (int i = 0; i < maxKeys; i++) {
            for (int j = 0; j < maxKeys; j++) {
                mm.put(i, j);
            }
        }
        assertOpenEventually(listener.addLatch);
    }
View Full Code Here


    @Test
    public void testListenerEntryAddEvent_whenValueNotIncluded() throws InterruptedException {
        final int maxKeys = 21;
        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);
            }
        }
        assertOpenEventually(listener.addLatch);
    }
View Full Code Here

    @Test
    public void testListenerEntryRemoveEvent() throws InterruptedException {
        final int maxKeys = 25;
        final int maxItems = 3;
        final MultiMap mm = client.getMultiMap(randomString());

        MyEntryListener listener = new CountDownValueNotNullListener(maxKeys * maxItems);
        mm.addEntryListener(listener, true);

        for (int i = 0; i < maxKeys; i++) {
            for (int j = 0; j < maxKeys; j++) {
                mm.put(i, j);
                mm.remove(i);
            }
        }
        assertOpenEventually(listener.removeLatch);
    }
View Full Code Here

    @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);
    }
View Full Code Here

    @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);
    }
View Full Code Here

    @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);
    }
View Full Code Here

    @Test
    public void testListenerOnKeyEntryRemoveEvent() throws InterruptedException {
        final Object key = "key";
        final int maxItems = 88;
        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);
            mm.remove(key, i);
        }

        assertOpenEventually(listener.removeLatch);
    }
View Full Code Here

    @Test
    public void testListenerOnKeyEntryRemoveEvent_whenValueNotIncluded() throws InterruptedException {
        final Object key = "key";
        final int maxItems = 62;
        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);
            mm.remove(key, i);
        }

        assertOpenEventually(listener.removeLatch);
    }
View Full Code Here

    @Test
    public void testListenerOnKeyEntryRemove_WithOneRemove() throws InterruptedException {
        final Object key = "key";
        final int maxItems = 98;
        final MultiMap mm = client.getMultiMap(randomString());

        MyEntryListener listener = new CountDownValueNotNullListener(maxItems, 1);
        final String id = mm.addEntryListener(listener, key, true);

        for (int i = 0; i < maxItems; i++) {
            mm.put(key, i);
        }
        mm.remove(key);

        assertOpenEventually(listener.removeLatch);
    }
View Full Code Here

    @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 String id = mm.addEntryListener(listener, key, false);

        for (int i = 0; i < maxItems; i++) {
            mm.put(key, i);
        }
        mm.remove(key);

        assertOpenEventually(listener.removeLatch);
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.MultiMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.