Package com.hazelcast.core

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


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

        ref.alter(null);
    }

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


        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

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

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

    }

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

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

        ref.alter(null);
    }

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

    public void alter_whenException() {
        IAtomicLong ref = client.getAtomicLong("alter_whenException");
        ref.set(10);

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

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

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

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

    }

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