use of org.apache.commons.configuration.AbstractConfiguration in project java-chassis by ServiceComb.
the class TestRegistry method initSetup.
@BeforeClass
public static void initSetup() {
AbstractConfiguration dynamicConfig = ConfigUtil.createLocalConfig();
ConcurrentCompositeConfiguration configuration = new ConcurrentCompositeConfiguration();
configuration.addConfiguration(dynamicConfig);
configuration.addConfiguration(inMemoryConfig);
ConfigurationManager.install(configuration);
}
use of org.apache.commons.configuration.AbstractConfiguration in project java-chassis by ServiceComb.
the class TestMicroServiceInstance method testCreateMicroserviceInstanceFromFile.
@Test
public void testCreateMicroserviceInstanceFromFile() {
AbstractConfiguration config = ConfigUtil.createLocalConfig();
ConcurrentCompositeConfiguration configuration = new ConcurrentCompositeConfiguration();
configuration.addConfiguration(config);
ConfigurationManager.install(configuration);
MicroserviceInstance instance = MicroserviceInstance.createFromDefinition(config);
Assert.assertEquals(instance.getDataCenterInfo().getName(), "myDC");
Assert.assertEquals(instance.getDataCenterInfo().getRegion(), "my-Region");
Assert.assertEquals(instance.getDataCenterInfo().getAvailableZone(), "my-Zone");
}
use of org.apache.commons.configuration.AbstractConfiguration in project java-chassis by ServiceComb.
the class TestConfigUtil method testCreateDynamicConfigNoConfigCenterSPI.
@Test
public void testCreateDynamicConfigNoConfigCenterSPI() {
AbstractConfiguration dynamicConfig = ConfigUtil.createLocalConfig();
Assert.assertNotEquals(DynamicWatchedConfiguration.class, ((ConcurrentCompositeConfiguration) dynamicConfig).getConfiguration(0).getClass());
}
use of org.apache.commons.configuration.AbstractConfiguration in project java-chassis by ServiceComb.
the class BootStrapProperties method toStringMap.
private static Map<String, String> toStringMap(AbstractConfiguration configuration) {
AbstractConfiguration root = findRoot(configuration);
Map<String, String> map = new LinkedHashMap<>();
configuration.getKeys().forEachRemaining(key -> {
Object value = configuration.getProperty(key);
// support placeholder
value = PropertyConverter.interpolate(value, root);
map.put(key, Objects.toString(value, null));
});
return map;
}
use of org.apache.commons.configuration.AbstractConfiguration in project java-chassis by ServiceComb.
the class TestLocalServiceRegistry method initSetup.
@BeforeClass
public static void initSetup() throws Exception {
AbstractConfiguration localConfig = ConfigUtil.createLocalConfig();
ConcurrentCompositeConfiguration configuration = new ConcurrentCompositeConfiguration();
configuration.addConfiguration(localConfig);
configuration.addConfiguration(inMemoryConfig);
ConfigurationManager.install(configuration);
}
Aggregations