Package info.archinnov.achilles.internal.context

Examples of info.archinnov.achilles.internal.context.ConfigurationContext


        doReturn(ALL).when(extractor).initDefaultWriteConsistencyLevel(params);
        doReturn(ImmutableMap.of("table1", EACH_QUORUM)).when(extractor).initReadConsistencyMap(params);
        doReturn(ImmutableMap.of("table2",ConsistencyLevel.LOCAL_QUORUM)).when(extractor).initWriteConsistencyMap(params);
        doReturn(ALL).when(extractor).initDefaultWriteConsistencyLevel(params);

        ConfigurationContext configContext = extractor.initConfigContext(params);

        // Then
        assertThat(configContext.isForceColumnFamilyCreation()).isTrue();
        assertThat(configContext.getJacksonMapperFactory()).isSameAs(factory);
        assertThat(configContext.getDefaultReadConsistencyLevel()).isEqualTo(ANY);
        assertThat(configContext.getDefaultWriteConsistencyLevel()).isEqualTo(ALL);
        assertThat(configContext.getDefaultWriteConsistencyLevel()).isEqualTo(ALL);
        assertThat(configContext.getBeanValidator()).isNull();
        assertThat(configContext.getPreparedStatementLRUCacheSize()).isEqualTo(DEFAULT_LRU_CACHE_SIZE);
        assertThat(configContext.getGlobalInsertStrategy()).isEqualTo(ALL_FIELDS);
        assertThat(configContext.getGlobalNamingStrategy()).isEqualTo(NamingStrategy.LOWER_CASE);
        assertThat(configContext.getCurrentKeyspace().isPresent()).isFalse();
        assertThat(configContext.getExecutorService()).isNotNull().isInstanceOf(ThreadPoolExecutor.class);
    }
View Full Code Here


    }

    public ConfigurationContext initConfigContext(ConfigMap configurationMap) {
        log.trace("Build ConfigurationContext from configuration map");

        ConfigurationContext configContext = new ConfigurationContext();
  configContext.setCurrentKeyspace(initKeyspaceName(configurationMap));
        configContext.setForceColumnFamilyCreation(initForceTableCreation(configurationMap));
        configContext.setEnableSchemaUpdate(initForceTableUpdate(configurationMap));
        configContext.setEnableSchemaUpdateForTables(initForceTableUpdateMap(configurationMap));
        configContext.setJacksonMapperFactory(initObjectMapperFactory(configurationMap));
        configContext.setDefaultReadConsistencyLevel(initDefaultReadConsistencyLevel(configurationMap));
        configContext.setDefaultWriteConsistencyLevel(initDefaultWriteConsistencyLevel(configurationMap));
        configContext.setReadConsistencyLevelMap(initReadConsistencyMap(configurationMap));
        configContext.setWriteConsistencyLevelMap(initWriteConsistencyMap(configurationMap));
        configContext.setBeanValidator(initValidator(configurationMap));
        configContext.setPreparedStatementLRUCacheSize(initPreparedStatementsCacheSize(configurationMap));
        configContext.setGlobalInsertStrategy(initInsertStrategy(configurationMap));
        configContext.setGlobalNamingStrategy(initGlobalNamingStrategy(configurationMap));
        configContext.setOSGIClassLoader(initOSGIClassLoader(configurationMap));
        configContext.setRelaxIndexValidation(initRelaxIndexValidation(configurationMap));
        configContext.setExecutorService(initExecutorService(configurationMap));
        return configContext;
    }
View Full Code Here

        assertThat(proxyClass1 == proxyClass2).isTrue();
    }

    @Test
    public void should_not_intercept_finalize_methods() throws Exception {
        Class<?> proxyClass = factory.createProxyClass(CompleteBean.class, new ConfigurationContext());

        try {
            proxyClass.getDeclaredMethod("finalize");
            fail("Should have reported the finalize method don't exists");
        } catch (NoSuchMethodException nsm) {
View Full Code Here

    private EntityParsingContext entityContext;
    private ConfigurationContext configContext;

    @Before
    public void setUp() {
        configContext = new ConfigurationContext();
        configContext.setDefaultReadConsistencyLevel(ConsistencyLevel.ONE);
        configContext.setDefaultWriteConsistencyLevel(ConsistencyLevel.ALL);
        configContext.setCurrentKeyspace(Optional.fromNullable("ks"));
        configContext.setGlobalNamingStrategy(NamingStrategy.LOWER_CASE);
    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.internal.context.ConfigurationContext

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.