Package info.archinnov.achilles.type

Examples of info.archinnov.achilles.type.Options


    @Test
    public void should_execute_async() throws Exception {
        //Given
        final Object[] boundValues = { "test" };
        final Options options = OptionsBuilder.ifNotExists();
        query = new NativeQuery(daoContext, configContext, regularStatement, options, boundValues);
        query.asyncUtils = asyncUtils;

        when(daoContext.execute(nativeStatementCaptor.capture())).thenReturn(futureResultSet);
        when(asyncUtils.transformFutureToEmpty(futureResultSet, executorService)).thenReturn(futureEmpty);
View Full Code Here


        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)
                .casResultListener(listener);
View Full Code Here

    private Options options = withConsistency(EACH_QUORUM);

    @Test
    public void should_override_runtime_value_by_batch_setting() throws Exception {
        //Given
        Options options = withConsistency(LOCAL_QUORUM);
        AbstractFlushContext flushContext = new BatchingFlushContext(null, EACH_QUORUM, NO_SERIAL_CONSISTENCY);

        //When
        final Options actual = overrider.overrideRuntimeValueByBatchSetting(options, flushContext);

        //Then
        assertThat(actual.getConsistencyLevel().isPresent()).isTrue();
        assertThat(actual.getConsistencyLevel().get()).isEqualTo(EACH_QUORUM);
    }
View Full Code Here

    }

    @Test
    public void should_not_override_runtime_value_if_no_batch() throws Exception {
        //Given
        Options options = withConsistency(LOCAL_QUORUM);
        AbstractFlushContext flushContext = new ImmediateFlushContext(null, EACH_QUORUM, NO_SERIAL_CONSISTENCY);

        //When
        final Options actual = overrider.overrideRuntimeValueByBatchSetting(options, flushContext);

        //Then
        assertThat(actual.getConsistencyLevel().isPresent()).isTrue();
        assertThat(actual.getConsistencyLevel().get()).isEqualTo(LOCAL_QUORUM);
    }
View Full Code Here

    private Function<Object, Object> function;

    @Test
    public void should_add_async_listener_from_options() throws Exception {
        //Given
        final Options options = OptionsBuilder.withAsyncListeners(callBack);
        when(listenableFuture.get()).thenReturn("test");
        //When
        asyncUtils.maybeAddAsyncListeners(listenableFuture, options, executorService);

        //Then
View Full Code Here

TOP

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

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.