* Description: operation timeout expired during execution, catch exception and continue immediately<br>
* Expectation: passes
*/
@Test
public void t152_operationTimeout() throws Exception {
SCMessage request = new SCMessage(TestConstants.pangram);
SCMessage response = null;
sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
msgCallback1 = new MsgCallback(sessionService1);
response = sessionService1.createSession(request, msgCallback1);
request.setMessageInfo(TestConstants.sleepCmd);
request.setData("5000"); // server will sleep 5000ms
sessionService1.send(3, request); // SC oti = 3*0.8*1000 = 2400ms => will return exception
msgCallback1.waitForMessage(10); // will wait max 10 seconds for response
response = msgCallback1.getResponse();
// second message
messageReceived = false;
request.setMessageInfo(TestConstants.echoCmd);
request.setData("gaga");
request.setDataLength(((String) request.getData()).length());
sessionService1.send(request);
msgCallback1.waitForMessage(10); // will wait max 10 seconds for response
response = msgCallback1.getResponse();
Assert.assertEquals("message body is not the same length", request.getDataLength(), response.getDataLength());
Assert.assertEquals("messageInfo is not the same", request.getMessageInfo(), response.getMessageInfo());
Assert.assertEquals("compression is not the same", request.isCompressed(), response.isCompressed());
// third message (synchronous)
request.setData("abraka-dabra");
request.setDataLength(((String) request.getData()).length());
response = sessionService1.execute(request);
Assert.assertEquals("message body is not the same length", request.getDataLength(), response.getDataLength());
Assert.assertEquals("messageInfo is not the same", request.getMessageInfo(), response.getMessageInfo());
Assert.assertEquals("compression is not the same", request.isCompressed(), response.isCompressed());
sessionService1.deleteSession();
}