Package com.hazelcast.core

Examples of com.hazelcast.core.IAtomicLong.incrementAndGet()


    public void testAtomicLong() throws Exception {
        String partitionKey = "hazelcast";
        HazelcastInstance hz = getHazelcastInstance(partitionKey);

        IAtomicLong atomicLong = hz.getAtomicLong("atomiclong@" + partitionKey);
        atomicLong.incrementAndGet();
        assertEquals("atomiclong@" + partitionKey, atomicLong.getName());
        assertEquals(partitionKey, atomicLong.getPartitionKey());

        AtomicLongService service = getNodeEngine(hz).getService(AtomicLongService.SERVICE_NAME);
        assertTrue(service.containsAtomicLong(atomicLong.getName()));
View Full Code Here


    @Test
    @ClientCompatibleTest
    public void testIncrementAndGet(){
        HazelcastInstance hzInstance = createHazelcastInstance();
        IAtomicLong atomicNumber = hzInstance.getAtomicLong(randomString());
        assertEquals(1,atomicNumber.incrementAndGet());
        assertEquals(2,atomicNumber.incrementAndGet());
    }

    @Test
    @ClientCompatibleTest
View Full Code Here

    @ClientCompatibleTest
    public void testIncrementAndGet(){
        HazelcastInstance hzInstance = createHazelcastInstance();
        IAtomicLong atomicNumber = hzInstance.getAtomicLong(randomString());
        assertEquals(1,atomicNumber.incrementAndGet());
        assertEquals(2,atomicNumber.incrementAndGet());
    }

    @Test
    @ClientCompatibleTest
    public void testGetAndSet(){
View Full Code Here

        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

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.