use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class XSLTInterceptorTest method testXSLTParameter.
@Test
public void testXSLTParameter() throws Exception {
exc = new Exchange(null);
exc.setResponse(Response.ok().body(getClass().getResourceAsStream("/customer.xml"), true).build());
exc.setProperty("XSLT_COMPANY", "predic8");
XSLTInterceptor i = new XSLTInterceptor();
i.setXslt("classpath:/customer2personAddCompany.xsl");
i.init(new HttpRouter());
i.handleResponse(exc);
// printBodyContent();
assertXPath("/person/name/first", "Rick");
assertXPath("/person/name/last", "Cort\u00e9s Ribotta");
assertXPath("/person/address/street", "Calle P\u00fablica \"B\" 5240 Casa 121");
assertXPath("/person/address/city", "Omaha");
assertXPath("/person/company", "predic8");
}
use of com.predic8.membrane.core.HttpRouter 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();
}
use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class ServiceInvocationTest method createRouter.
private HttpRouter createRouter() throws Exception {
HttpRouter router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(createFirstRule());
router.getRuleManager().addProxyAndOpenPortIfNew(createServiceRule());
router.getTransport().getInterceptors().add(router.getTransport().getInterceptors().size() - 1, new MockInterceptor("transport-log"));
router.init();
return router;
}
use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class RewriteInterceptorIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
interceptor = new RewriteInterceptor();
interceptor.getMappings().add(new Mapping("/blz-service\\?wsdl", "/axis2/services/BLZService?wsdl", null));
Rule rule = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", 3006), "thomas-bayer.com", 80);
rule.getInterceptors().add(interceptor);
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(rule);
}
use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class REST2SOAPInterceptorIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
Rule rule = new ServiceProxy(new ServiceProxyKey("localhost", "*", ".*", 3004), "www.thomas-bayer.com", 80);
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(rule);
REST2SOAPInterceptor rest2SoapInt = new REST2SOAPInterceptor();
rest2SoapInt.setMappings(getMappings());
rule.getInterceptors().add(rest2SoapInt);
router.init();
}
Aggregations