use of org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl in project cxf by apache.
the class WSAFromJavaTest method testFaultFromNonAddressService.
@Test
public void testFaultFromNonAddressService() throws Exception {
new LoggingFeature().initialize(this.getBus());
AddNumberImpl port = getPort();
java.util.Map<String, Object> requestContext = ((BindingProvider) port).getRequestContext();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + PORT + "/AddNumberImplPort-noaddr");
long start = System.currentTimeMillis();
port.addNumbers(1, 2);
try {
port.addNumbers3(-1, -1);
} catch (Exception ex) {
// ignore, expected
}
long end = System.currentTimeMillis();
assertTrue((end - start) < 50000);
}
use of org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl in project cxf by apache.
the class WSAFromJavaTest method getPort.
private AddNumberImpl getPort() throws Exception {
URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers-fromjava.wsdl");
assertNotNull("WSDL is null", wsdl);
AddNumberImplService service = new AddNumberImplService(wsdl);
assertNotNull("Service is null ", service);
AddNumberImpl port = service.getAddNumberImplPort();
updateAddressPort(port, PORT);
return port;
}
use of org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl in project cxf by apache.
the class WSAFromJavaTest method testAddNumbers2.
@Test
public void testAddNumbers2() throws Exception {
ByteArrayOutputStream input = setupInLogging();
ByteArrayOutputStream output = setupOutLogging();
AddNumberImpl port = getPort();
assertEquals(3, port.addNumbers2(1, 2));
String base = "http://server.addr_fromjava.ws.systest.cxf.apache.org/AddNumberImpl";
String expectedOut = base + "/addNumbers2";
assertTrue(output.toString().indexOf(expectedOut) != -1);
String expectedIn = base + "/addNumbers2Response";
assertTrue(input.toString().indexOf(expectedIn) != -1);
}
use of org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl in project cxf by apache.
the class WSAFromJavaTest method testAddNumbers.
@Test
public void testAddNumbers() throws Exception {
ByteArrayOutputStream input = setupInLogging();
ByteArrayOutputStream output = setupOutLogging();
AddNumberImpl port = getPort();
assertEquals(3, port.addNumbers(1, 2));
String expectedOut = "http://cxf.apache.org/input";
assertTrue(output.toString().indexOf(expectedOut) != -1);
String expectedIn = "http://cxf.apache.org/output";
assertTrue(input.toString().indexOf(expectedIn) != -1);
}
Aggregations