instance.addRequestInterceptor(itcp1, 2);
}
public void testClearByClass() {
// remove a present class
HttpRequestInterceptor itcp1 = new TestHttpRequestInterceptorPlaceHolder();
HttpRequestInterceptor itcp2 = new TestHttpRequestInterceptorPlaceHolder();
HttpRequestInterceptor itcp3 = new HttpRequestInterceptor() {
public void process(
HttpRequest request,
HttpContext context) throws HttpException, IOException {
}
};
BasicHttpProcessor instance = new BasicHttpProcessor();
instance.addRequestInterceptor(itcp1);
instance.addRequestInterceptor(itcp2);
instance.addRequestInterceptor(itcp3);
instance.removeRequestInterceptorByClass(itcp1.getClass());
assertEquals(1, instance.getRequestInterceptorCount());
instance.removeRequestInterceptorByClass(itcp3.getClass());
assertEquals(0, instance.getRequestInterceptorCount());
// remove a not present class
instance.addRequestInterceptor(itcp1);
instance.addRequestInterceptor(itcp2);