本文整理匯總了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