Package com.hazelcast.test

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


    @Test
    @ClientCompatibleTest
    public void testAtomicLongFailure() {
        int k = 4;
        TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(k + 1);
        HazelcastInstance instance = nodeFactory.newHazelcastInstance();
        String name = "testAtomicLongFailure";
        IAtomicLong atomicLong = instance.getAtomicLong(name);
        atomicLong.set(100);
        for (int i = 0; i < k; i++) {
            HazelcastInstance newInstance = nodeFactory.newHazelcastInstance();
View Full Code Here


        HazelcastInstance instance = nodeFactory.newHazelcastInstance();
        String name = "testAtomicLongFailure";
        IAtomicLong atomicLong = instance.getAtomicLong(name);
        atomicLong.set(100);
        for (int i = 0; i < k; i++) {
            HazelcastInstance newInstance = nodeFactory.newHazelcastInstance();
            IAtomicLong newAtomicLong = newInstance.getAtomicLong(name);
            assertEquals((long) 100 + i, newAtomicLong.get());
            newAtomicLong.incrementAndGet();
            instance.shutdown();
            instance = newInstance;
View Full Code Here

    @ClientCompatibleTest
    public void testAtomicLongSpawnNodeInParallel() throws InterruptedException {
        int total = 6;
        int parallel = 2;
        final TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(total + 1);
        HazelcastInstance instance = nodeFactory.newHazelcastInstance();
        final String name = "testAtomicLongSpawnNodeInParallel";
        IAtomicLong atomicLong = instance.getAtomicLong(name);
        atomicLong.set(100);
        final ExecutorService ex = Executors.newFixedThreadPool(parallel);
        try {
View Full Code Here

                for (int j = 0; j < parallel; j++) {
                    final int id = j;
                    ex.execute(new Runnable() {
                        public void run() {
                            try {
                                instances[id] = nodeFactory.newHazelcastInstance();
                                instances[id].getAtomicLong(name).incrementAndGet();
                            } catch (Exception e) {
                                exceptionCount.incrementAndGet();
                                e.printStackTrace();
                            } finally {
View Full Code Here

    public void testGithubIssue2509()
            throws Exception {

        TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(2);

        HazelcastInstance h1 = nodeFactory.newHazelcastInstance();
        HazelcastInstance h2 = nodeFactory.newHazelcastInstance();

        UnDeserializable unDeserializable = new UnDeserializable(1);
        IExecutorService executorService = h1.getExecutorService("default");
        Issue2509Runnable task = new Issue2509Runnable(unDeserializable);
View Full Code Here

            throws Exception {

        TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(2);

        HazelcastInstance h1 = nodeFactory.newHazelcastInstance();
        HazelcastInstance h2 = nodeFactory.newHazelcastInstance();

        UnDeserializable unDeserializable = new UnDeserializable(1);
        IExecutorService executorService = h1.getExecutorService("default");
        Issue2509Runnable task = new Issue2509Runnable(unDeserializable);
        Future<?> future = executorService.submitToMember(task, h2.getCluster().getLocalMember());
View Full Code Here

        cfg.getMapConfig(mapName).setInMemoryFormat(InMemoryFormat.OBJECT);

        final int maxIterations = 50;

        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(maxIterations+1);
        HazelcastInstance instance1 = factory.newHazelcastInstance(cfg);

        for (int iteration = 0; iteration < maxIterations; iteration++) {
            HazelcastInstance instance2 = factory.newHazelcastInstance(cfg);

            final int maxTasks = 20;
View Full Code Here

        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(maxIterations+1);
        HazelcastInstance instance1 = factory.newHazelcastInstance(cfg);

        for (int iteration = 0; iteration < maxIterations; iteration++) {
            HazelcastInstance instance2 = factory.newHazelcastInstance(cfg);

            final int maxTasks = 20;
            final Object key = generateKeyOwnedBy(instance2);

            final IMap<Object, List<Integer>> processorMap = instance1.getMap(mapName);
View Full Code Here

public class InvocationTest extends HazelcastTestSupport {

    @Test
    public void whenPartitionTargetMemberDiesThenOperationSendToNewPartitionOwner() throws Exception {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
        HazelcastInstance local = factory.newHazelcastInstance();
        HazelcastInstance remote = factory.newHazelcastInstance();
        warmUpPartitions(local, remote);

        Node localNode = getNode(local);
        OperationService service = localNode.nodeEngine.getOperationService();
View Full Code Here

    @Test
    public void whenPartitionTargetMemberDiesThenOperationSendToNewPartitionOwner() throws Exception {
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
        HazelcastInstance local = factory.newHazelcastInstance();
        HazelcastInstance remote = factory.newHazelcastInstance();
        warmUpPartitions(local, remote);

        Node localNode = getNode(local);
        OperationService service = localNode.nodeEngine.getOperationService();
        Operation op = new PartitionTargetOperation();
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.