Package com.hazelcast.test

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


            }
            final Config config = new Config();
            config.getMapConfig(mapName).setBackupCount(backupCount).setInMemoryFormat(inMemoryFormat);
            // nodes.
            final TestHazelcastInstanceFactory instanceFactory = new TestHazelcastInstanceFactory(nodeCount);
            nodes = instanceFactory.newInstances(config);
            return nodes[0].getMap(mapName);
        }

        public long totalHeapCost() {
            long heapCost = 0L;
View Full Code Here


            config.setProperty(GroupProperties.PROP_MAP_REPLICA_SCHEDULED_TASK_DELAY_SECONDS,
                    String.valueOf(backupCount));
        }
        // nodes.
        final TestHazelcastInstanceFactory instanceFactory = new TestHazelcastInstanceFactory(nodeCount);
        nodes = instanceFactory.newInstances(config);
        return nodes[0].getMap(mapName);
    }

    public HazelcastInstance[] getNodes() {
        return nodes;
View Full Code Here

    public void testListener() throws Exception {
        final String name = randomString();
        final int count = 10;
        final int insCount = 4;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(insCount);
        final HazelcastInstance[] instances = factory.newInstances();
        ListenerTest listener = new ListenerTest(count);
        getList(instances, name).addItemListener(listener, true);

        for (int i = 0; i < count; i++) {
            getList(instances, name).add("item" + i);
View Full Code Here

    @Test
    public void testAddRemove() {
        final String name = randomString();
        final int count = 100;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
        final HazelcastInstance[] instances = factory.newInstances();
        IList list1 = instances[0].getList(name);
        IList list2 = instances[1].getList(name);
        for (int i = 0; i < count; i++) {
            assertTrue(list1.add("item" + i));
            assertTrue(list2.add("item" + i));
View Full Code Here

    @Test
    public void testShutdown() {
        final String name = randomString();
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
        final HazelcastInstance[] instances = factory.newInstances();
        IList list1 = instances[0].getList(name);
        IList list2 = instances[1].getList(name);
        warmUpPartitions(instances);

        for (int i = 0; i < 50; i++) {
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.