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