Search in sources :

Example 56 with AbstractConfiguration

use of org.apache.commons.configuration.AbstractConfiguration in project incubator-servicecomb-java-chassis by apache.

the class TestConfigUtil method testCreateConfigFromConfigCenterNoUrl.

@Test
public void testCreateConfigFromConfigCenterNoUrl(@Mocked Configuration localConfiguration) {
    AbstractConfiguration configFromConfigCenter = ConfigUtil.createConfigFromConfigCenter(localConfiguration);
    Assert.assertNull(configFromConfigCenter);
}
Also used : AbstractConfiguration(org.apache.commons.configuration.AbstractConfiguration) Test(org.junit.Test)

Example 57 with AbstractConfiguration

use of org.apache.commons.configuration.AbstractConfiguration in project incubator-servicecomb-java-chassis by apache.

the class TestConfigUtil method testCreateDynamicConfigHasConfigCenter.

@Test
public void testCreateDynamicConfigHasConfigCenter(@Mocked ConfigCenterConfigurationSource configCenterConfigurationSource) {
    AbstractConfiguration dynamicConfig = ConfigUtil.createDynamicConfig();
    Assert.assertEquals(DynamicWatchedConfiguration.class, ((ConcurrentCompositeConfiguration) dynamicConfig).getConfiguration(0).getClass());
}
Also used : AbstractConfiguration(org.apache.commons.configuration.AbstractConfiguration) ConcurrentCompositeConfiguration(com.netflix.config.ConcurrentCompositeConfiguration) Test(org.junit.Test)

Example 58 with AbstractConfiguration

use of org.apache.commons.configuration.AbstractConfiguration in project incubator-servicecomb-java-chassis by apache.

the class TestLoadbalanceHandler method beforeCls.

@BeforeClass
public static void beforeCls() {
    ConfigUtil.installDynamicConfig();
    AbstractConfiguration configuration = (AbstractConfiguration) DynamicPropertyFactory.getBackingConfigurationSource();
    configuration.addProperty("cse.loadbalance.test.transactionControl.policy", "org.apache.servicecomb.loadbalance.filter.SimpleTransactionControlFilter");
    configuration.addProperty("cse.loadbalance.test.transactionControl.options.tag0", "value0");
    configuration.addProperty("cse.loadbalance.test.isolation.enabled", "true");
    configuration.addProperty("cse.loadbalance.serverListFilters", "a");
    configuration.addProperty("cse.loadbalance.serverListFilter.a.className", "org.apache.servicecomb.loadbalance.MyServerListFilterExt");
}
Also used : AbstractConfiguration(org.apache.commons.configuration.AbstractConfiguration) BeforeClass(org.junit.BeforeClass)

Example 59 with AbstractConfiguration

use of org.apache.commons.configuration.AbstractConfiguration in project incubator-servicecomb-java-chassis by apache.

the class TestSimpleTransactionControlFilter method beforeCls.

@BeforeClass
public static void beforeCls() {
    AbstractConfiguration configuration = new BaseConfiguration();
    configuration.addProperty("cse.loadbalance.test.flowsplitFilter.policy", "org.apache.servicecomb.loadbalance.filter.SimpleFlowsplitFilter");
    configuration.addProperty("cse.loadbalance.test.flowsplitFilter.options.tag0", "value0");
}
Also used : AbstractConfiguration(org.apache.commons.configuration.AbstractConfiguration) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) BeforeClass(org.junit.BeforeClass)

Example 60 with AbstractConfiguration

use of org.apache.commons.configuration.AbstractConfiguration in project incubator-gobblin by apache.

the class DatabaseJobHistoryStoreSchemaManager method getProperties.

private static Properties getProperties(Configuration config) {
    Properties props = new Properties();
    char delimiter = (config instanceof AbstractConfiguration) ? ((AbstractConfiguration) config).getListDelimiter() : ',';
    Iterator keys = config.getKeys();
    while (keys.hasNext()) {
        String key = (String) keys.next();
        List list = config.getList(key);
        props.setProperty("flyway." + key, StringUtils.join(list.iterator(), delimiter));
    }
    return props;
}
Also used : AbstractConfiguration(org.apache.commons.configuration.AbstractConfiguration) Iterator(java.util.Iterator) List(java.util.List) Properties(java.util.Properties)

Aggregations

AbstractConfiguration (org.apache.commons.configuration.AbstractConfiguration)80 Test (org.junit.Test)29 ConcurrentCompositeConfiguration (com.netflix.config.ConcurrentCompositeConfiguration)18 BeforeClass (org.junit.BeforeClass)10 Configuration (org.apache.commons.configuration.Configuration)9 URI (java.net.URI)6 BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)6 HttpRequest (com.netflix.client.http.HttpRequest)5 ArrayList (java.util.ArrayList)5 DynamicConfiguration (com.netflix.config.DynamicConfiguration)4 EnvironmentConfiguration (org.apache.commons.configuration.EnvironmentConfiguration)4 SystemConfiguration (org.apache.commons.configuration.SystemConfiguration)4 HttpResponse (com.netflix.client.http.HttpResponse)3 ConcurrentMapConfiguration (com.netflix.config.ConcurrentMapConfiguration)3 ExpandedConfigurationListenerAdapter (com.netflix.config.ExpandedConfigurationListenerAdapter)3 LinkedHashMap (java.util.LinkedHashMap)3 Properties (java.util.Properties)3 AggregatedConfiguration (com.netflix.config.AggregatedConfiguration)2 ConfigurationManager (com.netflix.config.ConfigurationManager)2 DynamicURLConfiguration (com.netflix.config.DynamicURLConfiguration)2