Package info.archinnov.achilles.listener

Examples of info.archinnov.achilles.listener.CASResultListener


        final Insert statement = insertInto("CompleteBean").ifNotExists().value("id", bindMarker("id")).value("name", bindMarker("name"));

        final AtomicBoolean error = new AtomicBoolean(false);
        final AtomicReference<CASResult> result = new AtomicReference<>(null);

        CASResultListener listener = new CASResultListener() {
            @Override
            public void onCASSuccess() {

            }
View Full Code Here


        when(meta.structure().isClusteredCounter()).thenReturn(true);
        when(meta.getAllCounterMetas()).thenReturn(asList(counterMeta));
        when(meta.getAllMetasExceptCounters()).thenReturn(asList(nameMeta));

        Options.CASCondition casCondition = new Options.CASCondition("test", "test");
        CASResultListener listener = mock(CASResultListener.class);
        final Options options = OptionsBuilder
                .withConsistency(LOCAL_ONE)
                .withTimestamp(100L)
                .withTtl(9)
                .ifConditions(casCondition)
View Full Code Here

    @Test
    public void should_execute_cas_successfully() throws Exception {
        //Given
        final AtomicBoolean casSuccess = new AtomicBoolean(false);
        CASResultListener listener = new CASResultListener() {
            @Override
            public void onCASSuccess() {
                casSuccess.compareAndSet(false, true);
            }
View Full Code Here

    @Test
    public void should_throw_exception_on_cas_error() throws Exception {
        //Given
        final AtomicReference<CASResult> atomicCASResult = new AtomicReference<>(null);
        CASResultListener listener = new CASResultListener() {
            @Override
            public void onCASSuccess() {
            }

            @Override
View Full Code Here

                exceptionSpy.getAndSet(t);
                latch.countDown();
            }
        };
        //When
        CASResultListener casListener = new CASResultListener() {
            @Override
            public void onCASSuccess() {

            }
View Full Code Here

    }

    @Test
    public void should_insert_and_notify_cas_listener_on_success() throws Exception {
        final AtomicBoolean casSuccess = new AtomicBoolean(false);
        CASResultListener listener = new CASResultListener() {
            @Override
            public void onCASSuccess() {
                casSuccess.compareAndSet(false, true);
            }
View Full Code Here

    @Test
    public void should_notify_listener_when_trying_to_insert_with_cas_because_already_exist() throws Exception {
        //Given
        final AtomicReference<CASResult> atomicCASResult = new AtomicReference(null);
        CASResultListener listener = new CASResultListener() {
            @Override
            public void onCASSuccess() {
            }

            @Override
View Full Code Here

    @Test
    public void should_notify_listener_when_trying_to_insert_with_cas_and_ttl_because_already_exist() throws Exception {
        //Given
        final AtomicReference<CASResult> atomicCASResult = new AtomicReference(null);
        CASResultListener listener = new CASResultListener() {
            @Override
            public void onCASSuccess() {
            }

            @Override
View Full Code Here

    @Test
    public void should_notify_listener_when_failing_cas_update() throws Exception {
        //Given
        final AtomicReference<CASResult> atomicCASResult = new AtomicReference(null);
        CASResultListener listener = new CASResultListener() {
            @Override
            public void onCASSuccess() {
            }

            @Override
View Full Code Here

    @Test
    public void should_notify_listener_when_failing_cas_update_with_ttl() throws Exception {
        //Given
        final AtomicReference<CASResult> atomicCASResult = new AtomicReference(null);
        CASResultListener listener = new CASResultListener() {
            @Override
            public void onCASSuccess() {
            }

            @Override
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.listener.CASResultListener

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.