本文整理汇总了Java中org.apache.commons.configuration.AbstractConfiguration.clearProperty方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractConfiguration.clearProperty方法的具体用法?Java AbstractConfiguration.clearProperty怎么用?Java AbstractConfiguration.clearProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.configuration.AbstractConfiguration
的用法示例。
在下文中一共展示了AbstractConfiguration.clearProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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
示例2: tearDown
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@After
public void tearDown() throws Exception {
IsolationServerListFilter = null;
loadBalancerStats = null;
AbstractConfiguration configuration =
(AbstractConfiguration) DynamicPropertyFactory.getBackingConfigurationSource();
configuration.clearProperty("cse.loadbalance.isolation.continuousFailureThreshold");
}
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:10,代码来源:TestIsolationServerListFilter.java
示例3: tearDown
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@After
public void tearDown() throws Exception {
final AbstractConfiguration configInst = ConfigurationManager.getConfigInstance();
configInst.clearProperty(AdminConfigImpl.CONTAINER_LISTEN_PORT);
if (container != null) {
container.shutdown();
}
}
示例4: addApplicationContext
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
public static void addApplicationContext(ConfigurableApplicationContext context) {
AbstractConfiguration config = ConfigurationManager.getConfigInstance();
config.clearProperty(APPLICATION_CONTEXT);
config.setProperty(APPLICATION_CONTEXT, context);
}
示例5: cleanup
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@AfterClass
public static void cleanup() {
final AbstractConfiguration configInst = ConfigurationManager.getConfigInstance();
configInst.clearProperty(AdminConfigImpl.CONTAINER_LISTEN_PORT);
}
示例6: checkAuthFilter
import org.apache.commons.configuration.AbstractConfiguration; //导入方法依赖的package包/类
@Test
public void checkAuthFilter() throws Exception {
setConfig(AdminConfigImpl.NETFLIX_ADMIN_CTX_FILTERS, "netflix.adminresources.AuthFilter");
try (AdminResourcesFixture testFixture = adminTestFixture()) {
HttpClient client = new DefaultHttpClient();
HttpGet healthGet = new HttpGet(String.format("http://localhost:%d/jr/ping", testFixture.serverPort));
HttpResponse response = client.execute(healthGet);
assertEquals("admin resource ping resource failed.", 200, response.getStatusLine().getStatusCode());
consumeResponse(response);
healthGet = new HttpGet(String.format("http://localhost:%d/main/get-user-id", testFixture.serverPort));
response = client.execute(healthGet);
assertEquals("admin resource ping resource failed.", 403, response.getStatusLine().getStatusCode());
consumeResponse(response);
healthGet = new HttpGet(String.format("http://localhost:%d/auth/no-page", testFixture.serverPort));
response = client.execute(healthGet);
assertEquals("admin resource ping resource failed.", 404, response.getStatusLine().getStatusCode());
consumeResponse(response);
healthGet = new HttpGet(String.format("http://localhost:%d/foo/ping", testFixture.serverPort));
response = client.execute(healthGet);
assertEquals("admin resource ping resource failed.", 404, response.getStatusLine().getStatusCode());
consumeResponse(response);
// verify redirect filter gets applied
healthGet = new HttpGet(String.format("http://localhost:%d/check-me", testFixture.serverPort));
response = client.execute(healthGet);
assertEquals("admin resource did not pick a custom redirect routing", 200,
response.getStatusLine().getStatusCode());
BufferedReader br = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
assertEquals("ping resource did not return pong", br.readLine(), "pong");
// verify auth filter not applied to a potential redirect path
healthGet = new HttpGet(String.format("http://localhost:%d/auth/ping", testFixture.serverPort));
response = client.execute(healthGet);
assertEquals("admin resource did not pick a custom redirect routing", 200,
response.getStatusLine().getStatusCode());
br = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
assertEquals("ping resource did not return pong", br.readLine(), "pong");
} finally {
final AbstractConfiguration configInst = ConfigurationManager.getConfigInstance();
configInst.clearProperty(AdminConfigImpl.NETFLIX_ADMIN_CTX_FILTERS);
}
}