Package info.archinnov.achilles.listener.CASResultListener

Examples of info.archinnov.achilles.listener.CASResultListener.CASResult.currentValues()


        //Then
        final CASResult actual = atomicCASResult.get();
        assertThat(actual).isNotNull();
        assertThat(actual.operation()).isEqualTo(UPDATE);
        assertThat(actual.currentValues()).contains(MapEntry.entry("[applied]", false), MapEntry.entry("name", "Helen"));
    }

    @Test
    public void should_notify_listener_on_cas_error() throws Exception {
        //Given
View Full Code Here


        manager.insert(entityWithEnum, OptionsBuilder.ifNotExists().casResultListener(listener));

        final CASResult casResult = atomicCASResult.get();
        assertThat(casResult.operation()).isEqualTo(INSERT);
        assertThat(casResult.currentValues()).isEqualTo(expectedCurrentValues);
        assertThat(casResult.toString()).isEqualTo("CAS operation INSERT cannot be applied. Current values are: {[applied]=false, consistency_level=EACH_QUORUM, id=10, name=name}");
    }


    @Test
View Full Code Here

        manager.insert(entityWithEnum, OptionsBuilder.ifNotExists()
                .withTtl(100).casResultListener(listener));

        final CASResult casResult = atomicCASResult.get();
        assertThat(casResult.operation()).isEqualTo(INSERT);
        assertThat(casResult.currentValues()).isEqualTo(expectedCurrentValues);
        assertThat(casResult.toString()).isEqualTo("CAS operation INSERT cannot be applied. Current values are: {[applied]=false, consistency_level=EACH_QUORUM, id=10, name=name}");
    }


    @Test
View Full Code Here

                        .casResultListener(listener));

        final CASResult casResult = atomicCASResult.get();
        assertThat(casResult).isNotNull();
        assertThat(casResult.operation()).isEqualTo(UPDATE);
        assertThat(casResult.currentValues()).isEqualTo(expectedCurrentValues);
        assertThat(casResult.toString()).isEqualTo("CAS operation UPDATE cannot be applied. Current values are: {[applied]=false, consistency_level=EACH_QUORUM, name=John}");
    }

    @Test
    public void should_notify_listener_when_failing_cas_update_with_ttl() throws Exception {
View Full Code Here

                        .withTtl(100));

        final CASResult casResult = atomicCASResult.get();
        assertThat(casResult).isNotNull();
        assertThat(casResult.operation()).isEqualTo(UPDATE);
        assertThat(casResult.currentValues()).isEqualTo(expectedCurrentValues);
        assertThat(casResult.toString()).isEqualTo("CAS operation UPDATE cannot be applied. Current values are: {[applied]=false, consistency_level=EACH_QUORUM, name=John}");
    }

    @Test
    public void should_update_set_with_cas_condition() throws Exception {
View Full Code Here

        //Then
        final CASResult casResult = atomicCASResult.get();
        assertThat(casResult).isNotNull();
        assertThat(casResult.operation()).isEqualTo(UPDATE);
        assertThat(casResult.currentValues()).isEqualTo(expectedCurrentValues);

    }

    @Test
    public void should_notify_listener_when_cas_error_on_native_query() throws Exception {
View Full Code Here

        //Then
        final CASResult casResult = atomicCASResult.get();

        assertThat(casResult).isNotNull();
        assertThat(casResult.operation()).isEqualTo(UPDATE);
        assertThat(casResult.currentValues()).isEqualTo(expectedCurrentValues);
    }

}
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.