Package info.archinnov.achilles.type.Options

Examples of info.archinnov.achilles.type.Options.CASCondition


        Map<String, Object> expectedCurrentValues = ImmutableMap.<String, Object>of("[applied]", false, "consistency_level", EACH_QUORUM.name(), "name", "John");
        managed.setName("Helen");

        //When
        manager.update(managed,
                ifConditions(new CASCondition("name", "name"), new CASCondition("consistency_level", EACH_QUORUM))
                        .casResultListener(listener)
                        .withTtl(100));

        final CASResult casResult = atomicCASResult.get();
        assertThat(casResult).isNotNull();
View Full Code Here


        final CompleteBean managed = manager.insert(entity);
        managed.getFollowers().add("Helen");
        managed.getFollowers().remove("Paul");

        //When
        manager.update(managed, ifConditions(new CASCondition("name", "John")).withTtl(100));

        //Then
        final CompleteBean actual = manager.find(CompleteBean.class, entity.getId());
        assertThat(actual.getFollowers()).containsOnly("Helen", "Andrew");
    }
View Full Code Here

        final CompleteBean managed = manager.insert(entity);
        managed.getFriends().set(0, "Helen");
        managed.getFriends().set(1, null);

        //When
        manager.update(managed, ifConditions(new CASCondition("name", "John")).withTtl(100));

        //Then
        final CompleteBean actual = manager.find(CompleteBean.class, entity.getId());
        assertThat(actual.getFriends()).containsExactly("Helen");
    }
View Full Code Here

        CompleteBean entity = builder().randomId().name("John").addFollowers("Paul", "Andrew").buid();
        final CompleteBean managed = manager.insert(entity);
        managed.getFollowers().add("Helen");

        //When
        manager.update(managed, ifConditions(new CASCondition("name", "Helen")).casResultListener(listener));

        //Then
        final CASResult casResult = atomicCASResult.get();
        assertThat(casResult).isNotNull();
        assertThat(casResult.operation()).isEqualTo(UPDATE);
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.type.Options.CASCondition

Copyright © 2018 www.massapicom. 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.