use of org.apache.camel.hello_world_soap_http.GreeterService in project camel by apache.
the class WSSecurityRouteTest method testSignature.
@Test
public void testSignature() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterSignaturePort();
((BindingProvider) greeter).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + CXFTestSupport.getPort2() + "/WSSecurityRouteTest/GreeterSignaturePort");
assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
use of org.apache.camel.hello_world_soap_http.GreeterService in project camel by apache.
the class WSSecurityRouteTest method testEncryption.
@Test
public void testEncryption() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterEncryptionPort();
((BindingProvider) greeter).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + CXFTestSupport.getPort2() + "/WSSecurityRouteTest/GreeterEncryptionPort");
assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
use of org.apache.camel.hello_world_soap_http.GreeterService in project camel by apache.
the class WSSecurityRouteTest method testUsernameToken.
@Test
public void testUsernameToken() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterUsernameTokenPort();
((BindingProvider) greeter).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + CXFTestSupport.getPort2() + "/WSSecurityRouteTest/GreeterUsernameTokenPort");
assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
use of org.apache.camel.hello_world_soap_http.GreeterService in project camel by apache.
the class WSSecurityRouteTest method testSecurityPolicy.
@Test
public void testSecurityPolicy() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterSecurityPolicyPort();
((BindingProvider) greeter).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + CXFTestSupport.getPort2() + "/WSSecurityRouteTest/GreeterSecurityPolicyPort");
assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
Aggregations