Java Code Examples for org.apache.commons.configuration.Configuration.addProperty()

The following are Jave code examples for showing how to use addProperty() of the org.apache.commons.configuration.Configuration class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: incubator-servicecomb-java-chassis   File: TestServiceRegistryConfig.java   Source Code and License Vote up 7 votes
@Test
public void getMicroserviceVersionFactory() {
  DynamicPropertyFactory.getInstance();
  Configuration config = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
  config.addProperty(ServiceRegistryConfig.MICROSERVICE_VERSION_FACTORY, "test");

  Assert.assertEquals("test", ServiceRegistryConfig.INSTANCE.getMicroserviceVersionFactory());

  config.clearProperty(ServiceRegistryConfig.MICROSERVICE_VERSION_FACTORY);
}
 
Example 2
Project: incubator-servicecomb-java-chassis   File: ArchaiusUtils.java   Source Code and License Vote up 6 votes
public static void setProperty(String key, Object value) {
  // ensure have instance
  DynamicPropertyFactory.getInstance();
  Configuration config = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
  config.addProperty(key, value);
}