use of org.eclipse.scout.jaxws.consumer.jaxwsconsumertestservice.SleepRequest in project scout.rt by eclipse.
the class AbstractJaxWsClientTest method testSamePortMultipleTimesSleepWithReadTimeoutCheckResponseHeaders.
@Test
public void testSamePortMultipleTimesSleepWithReadTimeoutCheckResponseHeaders() {
final JaxWsConsumerTestServicePortType port = BEANS.get(JaxWsConsumerTestClient.class).newInvocationContext().withReadTimeout(500, TimeUnit.MILLISECONDS).getPort();
// 1. invoke set header
final String testHeaderValue = "test header value";
SetHeaderRequest headerReq = new SetHeaderRequest();
headerReq.setHeaderName(X_SCOUT_JAX_WS_TEST_HEADER);
headerReq.setHeaderValue(testHeaderValue);
port.setHeader(headerReq);
assertHttpResponseHeader(port, X_SCOUT_JAX_WS_TEST_HEADER, testHeaderValue);
// 2. invoke sleep
SleepRequest req = new SleepRequest();
req.setMillis(5000);
try {
port.sleep(req);
fail("invocation is expected to be cancelled");
} catch (WebServiceException e) {
if (!(e.getCause() instanceof SocketTimeoutException)) {
throw e;
}
}
assertHttpResponseCode(port, 0);
assertHttpResponseHeader(port, X_SCOUT_JAX_WS_TEST_HEADER, null);
// 3. invoke echo
EchoRequest echoReq = new EchoRequest();
echoReq.setMessage("test message");
port.echo(echoReq);
assertHttpResponseCode(port, 200);
assertHttpResponseHeader(port, X_SCOUT_JAX_WS_TEST_HEADER, null);
}
Aggregations