Package com.hazelcast.core

Examples of com.hazelcast.core.HazelcastInstance.shutdown()


        String value = "value";

        IMap<String, String> map = h1.getMap(MAP_NAME);
        map.put(key, value);

        h2.shutdown();
        assertEquals(value, map.get(key));
    }
}
View Full Code Here


        }
        for (int i = 0; i < 5; i++) {
            assertEquals(((SampleObjects.Employee) res.get(i)).getState(), SampleObjects.State.STATE2);
        }
        instance1.shutdown();
        instance2.shutdown();
    }

    @Test
    public void testBackups() throws InterruptedException {
        TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(3);
View Full Code Here

        for (int i = 0; i < 1000; i++) {
            assertEquals((Object) (i + 1), map3.get(i));
        }
        instance2.shutdown();
        instance3.shutdown();

    }

    @Test
    public void testIssue825MapEntryProcessorDeleteSettingNull() throws InterruptedException {
View Full Code Here

        assertEquals(100, addCount.get());
        assertEquals(100, removeCount.get());
        assertEquals(100, updateCount.get());

        instance1.shutdown();
        instance2.shutdown();
    }


    @Test
    public void testMapEntryProcessorPartitionAware() throws InterruptedException {
View Full Code Here

        EntryProcessor entryProcessor = new IncrementorEntryProcessor();
        hz.getMap("default").executeOnKey(1, entryProcessor);

        assertEquals(124, hz.getMap("default").get(1));

        hz.shutdown();
    }

    @Test
    public void testSubmitToKey() throws InterruptedException, ExecutionException {
        TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(2);
View Full Code Here

        HazelcastInstance instance = nodeFactory.newHazelcastInstance(cfg);
        IMap<String, MyObject> map = instance.getMap(mapName);
        map.executeOnKey("key", new StoreOperation());
        Integer serialized = (Integer) map.executeOnKey("key", new FetchSerializedCount());
        assertEquals(expectedSerializationCount, serialized.intValue());
        instance.shutdown();
    }

    @Test
    public void testEntryProcessorNoDeserializationWithObjectFormat() {
        final String mapName = randomMapName();
View Full Code Here

        HazelcastInstance instance = nodeFactory.newHazelcastInstance(cfg);
        IMap<String, MyObject> map = instance.getMap(mapName);
        map.executeOnKey("key", new StoreOperation());
        Integer serialized = (Integer) map.executeOnKey("key", new FetchDeSerializedCount());
        assertEquals(expectedDeserializationCount, serialized.intValue());
        instance.shutdown();
    }

    @Test
    public void executionOrderTest() {
        String mapName = randomString();
View Full Code Here

        }
        for (int i = 0; i < size; i++) {
            assertEquals(map.get(i), res.get(i));
        }
        instance1.shutdown();
        instance2.shutdown();
    }


    @Test
    public void testBackupMapEntryProcessorAllKeys() throws InterruptedException {
View Full Code Here

        IMap<Integer, Integer> myMap = instance1.getMap("myMap");
        for (int i = 0; i < noOfRecords; i++) {
            myMap.put(i, i);
        }
        instance2.shutdown();
        instance3.shutdown();

        assertEquals("Some records have been lost.", noOfRecords, myMap.values().size());
    }

View Full Code Here

        assertEquals(2, q2.size());
        h1 = factory.newHazelcastInstance();
        q1 = h1.getQueue("q");
        assertEquals(2, q1.size());
        assertEquals(2, q2.size());
        h2.shutdown();
        assertEquals(2, q1.size());
    }

    @Test
    public void issue391() throws Exception {
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.