Examples of IAtomicLong


Examples of com.hazelcast.core.IAtomicLong

    @Test
    @ClientCompatibleTest
    public void apply_whenException() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("apply");
        ref.set(1);
        try {
            ref.apply(new FailingFunction());
            fail();
        } catch (WoohaaException expected) {
        }

        assertEquals(1, ref.get());
    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

    @Test(expected = IllegalArgumentException.class)
    @ClientCompatibleTest
    public void alter_whenCalledWithNullFunction() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("alter_whenCalledWithNullFunction");

        ref.alter(null);
    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

    @Test
    @ClientCompatibleTest
    public void alter_whenException() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("alter_whenException");
        ref.set(10);

        try {
            ref.alter(new FailingFunction());
            fail();
        } catch (WoohaaException expected) {
        }

        assertEquals(10, ref.get());
    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

    @Test
    @ClientCompatibleTest
    public void alter() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("alter");

        ref.set(10);
        ref.alter(new AddOneFunction());
        assertEquals(11, ref.get());

    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

    @Test(expected = IllegalArgumentException.class)
    @ClientCompatibleTest
    public void alterAndGet_whenCalledWithNullFunction() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("alterAndGet_whenCalledWithNullFunction");

        ref.alterAndGet(null);
    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

    @Test
    @ClientCompatibleTest
    public void alterAndGet_whenException() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("alterAndGet_whenException");
        ref.set(10);

        try {
            ref.alterAndGet(new FailingFunction());
            fail();
        } catch (WoohaaException expected) {
        }

        assertEquals(10, ref.get());
    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

    @Test
    @ClientCompatibleTest
    public void alterAndGet() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("alterAndGet");

        ref.set(10);
        assertEquals(11, ref.alterAndGet(new AddOneFunction()));
        assertEquals(11, ref.get());
    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

    @Test(expected = IllegalArgumentException.class)
    @ClientCompatibleTest
    public void getAndAlter_whenCalledWithNullFunction() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("getAndAlter_whenCalledWithNullFunction");

        ref.getAndAlter(null);
    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

    @Test
    @ClientCompatibleTest
    public void getAndAlter_whenException() {
        HazelcastInstance hazelcastInstance = createHazelcastInstance();
        IAtomicLong ref = hazelcastInstance.getAtomicLong("getAndAlter_whenException");
        ref.set(10);

        try {
            ref.getAndAlter(new FailingFunction());
            fail();
        } catch (WoohaaException expected) {
        }

        assertEquals(10, ref.get());
    }
View Full Code Here

Examples of com.hazelcast.core.IAtomicLong

        Hazelcast.shutdownAll();
    }

    @Test
    public void testUsageAfterDestroy() {
        IAtomicLong proxy = newClientProxy();
        proxy.destroy();
        proxy.get();
    }
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.