Examples of alterAndGet()


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

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

        ref.alterAndGet(null);
    }

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

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

        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.alterAndGet()

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

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

    @Test(expected = IllegalArgumentException.class)
    @ClientCompatibleTest
View Full Code Here

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

    @Test(expected = IllegalArgumentException.class)
    public void alterAndGet_whenCalledWithNullFunction() {
        IAtomicLong ref = client.getAtomicLong("alterAndGet_whenCalledWithNullFunction");

        ref.alterAndGet(null);
    }

    @Test
    public void alterAndGet_whenException() {
        IAtomicLong ref = client.getAtomicLong("alterAndGet_whenException");
View Full Code Here

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

    public void alterAndGet_whenException() {
        IAtomicLong ref = client.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.alterAndGet()

    @Test
    public void alterAndGet() {
        IAtomicLong ref = client.getAtomicLong("alterAndGet");

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

    @Test(expected = IllegalArgumentException.class)
    public void getAndAlter_whenCalledWithNullFunction() {
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.