本文整理汇总了Java中org.apache.commons.configuration.AbstractConfiguration.addProperty方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractConfiguration.addProperty方法的具体用法?Java AbstractConfiguration.addProperty怎么用?Java AbstractConfiguration.addProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.configuration.AbstractConfiguration
的用法示例。
在下文中一共展示了AbstractConfiguration.addProperty方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: beforeCls
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@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");
}
示例2: setUp
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
IsolationServerListFilter = new IsolationServerListFilter();
loadBalancerStats = new LoadBalancerStats("loadBalancer");
AbstractConfiguration configuration =
(AbstractConfiguration) DynamicPropertyFactory.getBackingConfigurationSource();
configuration.clearProperty("cse.loadbalance.isolation.enabled");
configuration.addProperty("cse.loadbalance.isolation.enabled",
"true");
configuration.clearProperty("cse.loadbalance.isolation.enableRequestThreshold");
configuration.addProperty("cse.loadbalance.isolation.enableRequestThreshold",
"3");
}
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:15,代码来源:TestIsolationServerListFilter.java
示例3: beforeCls
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@BeforeClass
public static void beforeCls() {
ConfigUtil.installDynamicConfig();
AbstractConfiguration configuration =
(AbstractConfiguration) DynamicPropertyFactory.getBackingConfigurationSource();
configuration.addProperty(REQUEST_TIMEOUT_KEY, 2000);
}
示例4: convertEnvVariable
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
public static AbstractConfiguration convertEnvVariable(AbstractConfiguration source) {
Iterator<String> keys = source.getKeys();
while (keys.hasNext()) {
String key = keys.next();
String[] separatedKey = key.split(CONFIG_KEY_SPLITER);
if (separatedKey.length == 1) {
continue;
}
String newKey = String.join(".", separatedKey);
source.addProperty(newKey, source.getProperty(key));
}
return source;
}
示例5: duplicateServiceCombConfigToCse
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
private static void duplicateServiceCombConfigToCse(AbstractConfiguration source) {
Iterator<String> keys = source.getKeys();
while (keys.hasNext()) {
String key = keys.next();
if (!key.startsWith(CONFIG_SERVICECOMB_PREFIX)) {
continue;
}
String cseKey = CONFIG_CSE_PREFIX + key.substring(key.indexOf(".") + 1);
source.addProperty(cseKey, source.getProperty(key));
}
}
示例6: duplicateServiceCombConfigToCseListValue
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@Test
public void duplicateServiceCombConfigToCseListValue() throws Exception {
List<String> list = Arrays.asList("a", "b");
AbstractConfiguration config = new DynamicConfiguration();
config.addProperty("servicecomb.list", list);
Deencapsulation.invoke(ConfigUtil.class, "duplicateServiceCombConfigToCse", config);
Object result = config.getProperty("cse.list");
assertThat(result, instanceOf(List.class));
assertThat(result, equalTo(list));
}
示例7: testConvertEnvVariable
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@Test
public void testConvertEnvVariable() {
String someProperty = "cse_service_registry_address";
AbstractConfiguration config = new DynamicConfiguration();
config.addProperty(someProperty, "testing");
AbstractConfiguration result = ConfigUtil.convertEnvVariable(config);
assertThat(result.getString("cse.service.registry.address"), equalTo("testing"));
assertThat(result.getString("cse_service_registry_address"), equalTo("testing"));
}
示例8: beforeCls
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@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");
}
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:8,代码来源:TestSimpleTransactionControlFilter.java