Package com.hazelcast.core

Examples of com.hazelcast.core.MultiMap


        assertEquals(0, mm.size());
    }

    @Test
    public void testGet_whenNotExist() {
        final MultiMap mm = client.getMultiMap(randomString());
        Collection coll = mm.get("NOT_THERE");

        assertEquals(Collections.EMPTY_SET, coll);
    }
View Full Code Here


    @Test
    public void testGet() {
        final Object key = "key";
        final int maxItemsPerKey = 33;
        final MultiMap mm = client.getMultiMap(randomString());

        Set expected = new TreeSet();
        for ( int i=0; i< maxItemsPerKey; i++ ){
            mm.put(key, i);
            expected.add(i);
        }

        Collection resultSet = new TreeSet( mm.get(key) );

        assertEquals(expected, resultSet);
    }
View Full Code Here

        assertEquals(expected, resultSet);
    }

    @Test
    public void testRemove_whenKeyNotExist() {
        final MultiMap mm = client.getMultiMap(randomString());
        Collection coll = mm.remove("NOT_THERE");

        assertEquals(Collections.EMPTY_SET, coll);
    }
View Full Code Here

    @Test
    public void testRemoveKey() {
        final Object key = "key";
        final int maxItemsPerKey = 44;
        final MultiMap mm = client.getMultiMap(randomString());

        Set expeted = new TreeSet();
        for ( int i=0; i< maxItemsPerKey; i++ ){
            mm.put(key, i);
            expeted.add(i);
        }
        Set resultSet  = new TreeSet( mm.remove(key) );

        assertEquals(expeted, resultSet);
        assertEquals(0, mm.size());
    }
View Full Code Here

    @Test
    public void testRemoveValue_whenValueNotExists() {
        final Object key = "key";
        final int maxItemsPerKey = 4;
        final MultiMap mm = client.getMultiMap(randomString());

        for ( int i=0; i< maxItemsPerKey; i++ ){
            mm.put(key, i);
        }
        boolean result = mm.remove(key, "NOT_THERE");

        assertFalse(result);
    }
View Full Code Here

    @Test
    public void testRemoveKeyValue() {
        final Object key = "key";
        final int maxItemsPerKey = 4;
        final MultiMap mm = client.getMultiMap(randomString());

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

        for ( int i=0; i< maxItemsPerKey; i++ ){
            boolean result = mm.remove(key, i);
            assertTrue(result);
        }
    }
View Full Code Here

        }
    }

    @Test(expected = UnsupportedOperationException.class)
    public void testLocalKeySet() {
        final MultiMap mm = client.getMultiMap(randomString());
        mm.localKeySet();
    }
View Full Code Here

        mm.localKeySet();
    }

    @Test
    public void testEmptyKeySet() {
        final MultiMap mm = client.getMultiMap(randomString());
        assertEquals(Collections.EMPTY_SET, mm.keySet());
    }
View Full Code Here

    }

    @Test
    public void testKeySet() {
        final int maxKeys = 23;
        final MultiMap mm = client.getMultiMap(randomString());

        Set expected = new TreeSet();
        for ( int key=0; key< maxKeys; key++ ){
            mm.put(key, 1);
            expected.add(key);
        }

        assertEquals(expected, mm.keySet());
    }
View Full Code Here

        assertEquals(expected, mm.keySet());
    }

    @Test
    public void testValues_whenEmptyCollection() {
        final MultiMap mm = client.getMultiMap(randomString());
        assertEquals(Collections.EMPTY_LIST, mm.values());
    }
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.