use of org.apache.hello_world.Greeter in project cxf by apache.
the class SSLv3Test method testClientSSL3NotAllowed.
@org.junit.Test
public void testClientSSL3NotAllowed() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = SSLv3Test.class.getResource("sslv3-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL url = SOAPService.WSDL_LOCATION;
SOAPService service = new SOAPService(url, SOAPService.SERVICE);
assertNotNull("Service is null", service);
final Greeter port = service.getHttpsPort();
assertNotNull("Port is null", port);
updateAddressPort(port, PORT3);
try {
port.greetMe("Kitty");
fail("Failure expected on the client not supporting SSLv3 by default");
} catch (Exception ex) {
// expected
}
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.apache.hello_world.Greeter in project cxf by apache.
the class SSLv3Test method testSSL3ClientToEndpointWithSSL3Allowed.
@org.junit.Test
public void testSSL3ClientToEndpointWithSSL3Allowed() throws Exception {
// Doesn't work with IBM JDK
if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
return;
}
SpringBusFactory bf = new SpringBusFactory();
URL busFile = SSLv3Test.class.getResource("sslv3-client-allow.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL url = SOAPService.WSDL_LOCATION;
SOAPService service = new SOAPService(url, SOAPService.SERVICE);
assertNotNull("Service is null", service);
final Greeter port = service.getHttpsPort();
assertNotNull("Port is null", port);
updateAddressPort(port, PORT4);
port.greetMe("Kitty");
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.apache.hello_world.Greeter in project cxf by apache.
the class HTTPConduitTest method testHttp2HttpRedirect.
/**
* This method tests if http to http redirects work.
* Rethwel redirects to Mortimer.
*/
@Test
public void testHttp2HttpRedirect() throws Exception {
startServer("Mortimer");
startServer("Rethwel");
URL config = getClass().getResource("Http2HttpRedirect.cxf");
// We go through the back door, setting the default bus.
new DefaultBusFactory().createBus(config);
URL wsdl = getClass().getResource("greeting.wsdl");
assertNotNull("WSDL is null", wsdl);
SOAPService service = new SOAPService(wsdl, serviceName);
assertNotNull("Service is null", service);
Greeter rethwel = service.getPort(rethwelQ, Greeter.class);
updateAddressPort(rethwel, getPort("PORT1"));
assertNotNull("Port is null", rethwel);
configureProxy(ClientProxy.getClient(rethwel));
String answer = rethwel.sayHi();
assertTrue("Unexpected answer: " + answer, "Bonjour from Mortimer".equals(answer));
assertProxyRequestCount(2);
}
use of org.apache.hello_world.Greeter in project cxf by apache.
the class HTTPConduitTest method getMortimerGreeter.
private Greeter getMortimerGreeter() throws MalformedURLException {
URL wsdl = getClass().getResource("greeting.wsdl");
assertNotNull("WSDL is null", wsdl);
SOAPService service = new SOAPService(wsdl, serviceName);
assertNotNull("Service is null", service);
Greeter mortimer = service.getPort(mortimerQ, Greeter.class);
assertNotNull("Port is null", mortimer);
updateAddressPort(mortimer, getPort("PORT0"));
configureProxy(ClientProxy.getClient(mortimer));
return mortimer;
}
use of org.apache.hello_world.Greeter in project cxf by apache.
the class HTTPConduitTest method testBasicConnection.
@Test
public void testBasicConnection() throws Exception {
startServer("Mortimer");
Greeter mortimer = getMortimerGreeter();
String answer = mortimer.sayHi();
answer = mortimer.sayHi();
answer = mortimer.sayHi();
assertTrue("Unexpected answer: " + answer, "Bonjour from Mortimer".equals(answer));
assertProxyRequestCount(3);
}
Aggregations