use of com.predic8.membrane.core.Router in project service-proxy by membrane.
the class UnavailableSoapProxyTest method setup.
@Before
public void setup() {
r = new Router();
HttpClientConfiguration httpClientConfig = new HttpClientConfiguration();
httpClientConfig.setMaxRetries(1);
r.setHttpClientConfig(httpClientConfig);
r.setHotDeploy(false);
r.setRetryInit(true);
sp = new SOAPProxy();
sp.setPort(2000);
sp.setWsdl("http://localhost:2001/axis2/services/BLZService?wsdl");
sp3 = new ServiceProxy();
sp3.setPort(2000);
sp3.setTarget(new AbstractServiceProxy.Target("localhost", 2001));
ValidatorInterceptor v = new ValidatorInterceptor();
v.setWsdl("http://localhost:2001/axis2/services/BLZService?wsdl");
sp3.getInterceptors().add(v);
SOAPProxy sp2 = new SOAPProxy();
sp2.setPort(2001);
sp2.setWsdl("http://www.thomas-bayer.com/axis2/services/BLZService?wsdl");
r2 = new Router();
r2.setHotDeploy(false);
r2.getRules().add(sp2);
// r2 will be started during the test
}
use of com.predic8.membrane.core.Router in project service-proxy by membrane.
the class ExceptionHandlingTest method setUp.
@Before
public void setUp() throws Exception {
router = new HttpRouter();
router.getTransport().setPrintStackTrace(printStackTrace);
ServiceProxy sp2 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", getPort()), "", -1);
sp2.getInterceptors().add(new AbstractInterceptor() {
@Override
public Outcome handleRequest(Exchange exc) throws Exception {
throw new Exception("secret");
}
});
router.getRuleManager().addProxyAndOpenPortIfNew(sp2);
router.init();
}
use of com.predic8.membrane.core.Router in project service-proxy by membrane.
the class BoundConnectionTest method setUp.
@Before
public void setUp() throws Exception {
router = new HttpRouter();
ServiceProxy sp1 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", 3021), "localhost", 3022);
router.getRuleManager().addProxyAndOpenPortIfNew(sp1);
ServiceProxy sp2 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", 3022), "", -1);
sp2.getInterceptors().add(new AbstractInterceptor() {
@Override
public Outcome handleRequest(Exchange exc) throws Exception {
exc.getRequest().readBody();
exc.setResponse(Response.ok("OK.").build());
connectionHash = ((HttpServerHandler) exc.getHandler()).getSrcOut().hashCode();
return Outcome.RETURN;
}
});
router.getRuleManager().addProxyAndOpenPortIfNew(sp2);
router.init();
}
use of com.predic8.membrane.core.Router in project service-proxy by membrane.
the class AccessControlInterceptorIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
Rule rule = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", 3008), "thomas-bayer.com", 80);
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(rule);
}
use of com.predic8.membrane.core.Router in project service-proxy by membrane.
the class WSDLPublisherTest method before.
@Before
public void before() throws Exception {
router = new HttpRouter();
ServiceProxy sp2 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", port), "", -1);
WSDLPublisherInterceptor wi = new WSDLPublisherInterceptor();
wi.setWsdl(wsdlLocation);
wi.init(router);
sp2.getInterceptors().add(wi);
router.getRuleManager().addProxyAndOpenPortIfNew(sp2);
router.init();
}
Aggregations