Package info.archinnov.achilles.type

Examples of info.archinnov.achilles.type.Counter


    @Test
    public void should_delete_static_counter_and_non_static_counter_column() throws Exception {
        //Given
        Long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);
        Counter version = CounterBuilder.incr(1L);
        final Counter count = CounterBuilder.incr(11);
        ClusteredEntityWithStaticCounter entity = new ClusteredEntityWithStaticCounter(new ClusteredKeyForCounter(partitionKey, "count1"), version, count);
        final ClusteredEntityWithStaticCounter managed = manager.insert(entity);

        //When
        manager.delete(managed);
View Full Code Here


    @Test
    public void should_persist_counters() throws Exception {
        //Given
        final long delta = 10L;
        final Counter counter = InternalCounterBuilder.incr(delta);
        when(counterMeta.forValues().getValueFromField(entity)).thenReturn(counter);

        //When
        persister.persistCounters(context, asList(counterMeta));
View Full Code Here

    @Test
    public void should_not_persist_counters_if_no_delta() throws Exception {
        //Given
        final long delta = 0L;
        final Counter counter = InternalCounterBuilder.incr(delta);
        when(counterMeta.forValues().getValueFromField(entity)).thenReturn(counter);

        //When
        persister.persistCounters(context, asList(counterMeta));
View Full Code Here

        assertThat(successSpy2.get()).isNotNull().isInstanceOf(CompleteBean.class).isNotInstanceOf(Factory.class);
    }

    @Test
    public void should_return_raw_entities_for_raw_typed_query_async() throws Exception {
        Counter counter1 = CounterBuilder.incr(15L);
        CompleteBean paul = builder().randomId().name("Paul").age(35L)
                .addFriends("foo", "bar").addFollowers("George", "Jack").addPreference(1, "FR")
                .addPreference(2, "Paris").addPreference(3, "75014").version(counter1).buid();

        Counter counter2 = CounterBuilder.incr(17L);
        CompleteBean john = builder().randomId().name("John").age(34L)
                .addFriends("qux", "twix").addFollowers("Isaac", "Lara").addPreference(1, "US")
                .addPreference(2, "NewYork").version(counter2).buid();

        manager.insert(paul);
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.type.Counter

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.