Package com.hazelcast.test

Examples of com.hazelcast.test.TestHazelcastInstanceFactory.newInstances()


    }

    @Test(expected = NullPointerException.class)
    public void testUnlock_whenNullKey() {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
        MultiMap multiMap = getMultiMap(factory.newInstances(), randomString());

        multiMap.unlock(null);
    }

    @Test(expected = NullPointerException.class)
View Full Code Here


    }

    @Test(expected = NullPointerException.class)
    public void testContainsKey_whenNullKey() throws InterruptedException {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
        MultiMap multiMap = getMultiMap(factory.newInstances(), randomString());

        multiMap.containsKey(null);
    }

    @Test(expected = NullPointerException.class)
View Full Code Here

    }

    @Test(expected = NullPointerException.class)
    public void testContainsValue_whenNullKey() throws InterruptedException {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
        MultiMap multiMap = getMultiMap(factory.newInstances(), randomString());

        multiMap.containsValue(null);
    }

    @Test(expected = NullPointerException.class)
View Full Code Here

    }

    @Test(expected = NullPointerException.class)
    public void testContainsEntry_whenNullKey() throws InterruptedException {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
        MultiMap multiMap = getMultiMap(factory.newInstances(), randomString());

        multiMap.containsEntry(null, "someVal");
    }

    @Test(expected = NullPointerException.class)
View Full Code Here

    }

    @Test(expected = NullPointerException.class)
    public void testContainsEntry_whenNullValue() throws InterruptedException {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
        MultiMap multiMap = getMultiMap(factory.newInstances(), randomString());

        multiMap.containsEntry("someVal", null);
    }

    @Test
View Full Code Here

        Config config = new Config();
        final String name = "defMM";
        config.getMultiMapConfig(name).setValueCollectionType(MultiMapConfig.ValueCollectionType.LIST);
        final int insCount = 4;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(insCount);
        final HazelcastInstance[] instances = factory.newInstances(config);

        assertTrue(getMultiMap(instances, name).put("key1", "key1_value1"));
        assertTrue(getMultiMap(instances, name).put("key1", "key1_value2"));

View Full Code Here

        Config config = new Config();
        final String name = "defMM";
        config.getMultiMapConfig(name).setValueCollectionType(MultiMapConfig.ValueCollectionType.LIST);
        final int insCount = 4;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(insCount);
        final HazelcastInstance[] instances = factory.newInstances(config);

        getMultiMap(instances, name).put("key1", "key1_val1");
        getMultiMap(instances, name).put("key1", "key1_val2");
        getMultiMap(instances, name).put("key1", "key1_val3");
View Full Code Here

        Config config = new Config();
        final String name = randomMapName();
        config.getMultiMapConfig(name).setValueCollectionType(MultiMapConfig.ValueCollectionType.LIST);
        final int insCount = 4;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(insCount);
        final HazelcastInstance[] instances = factory.newInstances(config);

        final Set keys = Collections.newSetFromMap(new ConcurrentHashMap());

        EntryListener listener = new EntryAdapter() {
            public void entryAdded(EntryEvent event) {
View Full Code Here

    // it must throw ClassCastException wrapped by HazelcastException
    @Test(expected = HazelcastException.class)
    public void testAggregateMultiMap_differentDataTypes() {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
        MultiMap<Object, Object> multiMap = getMultiMap(factory.newInstances(), randomString());

        multiMap.put(1, "fail");
        multiMap.put(2, 75);

        Integer aggregate = multiMap.aggregate(Supplier.all(), Aggregations.integerAvg());
View Full Code Here

    }

    @Test
    public void testAggregateMultiMap() {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(1);
        MultiMap<Object, Object> multiMap = getMultiMap(factory.newInstances(), randomString());

        Integer aggregate = multiMap.aggregate(Supplier.all(), Aggregations.integerAvg());
        assertEquals(0, aggregate.intValue());

        multiMap.put(1, 25);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.