try {
client.attach();
if (getMethodName() == "createSession_whiteSpaceSessionInfo_sessionIdIsNotEmpty") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage();
scMessage.setSessionInfo(" ");
sessionService.createSession(60, scMessage, new TestSessionServiceMessageCallback(sessionService));
sessionService.deleteSession();
} else if (getMethodName() == "createSession_arbitrarySpaceSessionInfo_sessionIdIsNotEmpty") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage();
scMessage.setSessionInfo("The quick brown fox jumps over a lazy dog.");
sessionService.createSession(60, scMessage, new TestSessionServiceMessageCallback(sessionService));
sessionService.deleteSession();
} else if (getMethodName() == "createSession_arbitrarySpaceSessionInfoDataOneChar_sessionIdIsNotEmpty") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage("a");
scMessage.setSessionInfo("The quick brown fox jumps over a lazy dog.");
sessionService.createSession(10, scMessage, new TestSessionServiceMessageCallback(sessionService));
sessionService.deleteSession();
} else if (getMethodName() == "createSession_256LongSessionInfoData60kBByteArray_sessionIdIsNotEmpty") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage(new byte[TestConstants.dataLength60kB]);
scMessage.setSessionInfo(TestConstants.stringLength256);
sessionService.createSession(60, scMessage, new TestSessionServiceMessageCallback(sessionService));
sessionService.deleteSession();
} else if (getMethodName() == "deleteSession_beforeCreateSession_noSessionId") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
sessionService.deleteSession();
} else if (getMethodName() == "deleteSession_afterValidNewSessionService_noSessionId") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage();
scMessage.setSessionInfo("sessionInfo");
sessionService.createSession(60, scMessage, new TestSessionServiceMessageCallback(sessionService));
sessionService.deleteSession();
} else if (getMethodName() == "createSession_rejectTheSessionThenCreateValidSessionThenExecuteAMessage_passes") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
try {
SCMessage scMessage = new SCMessage("reject");
scMessage.setSessionInfo("sessionInfo");
sessionService.createSession(60, scMessage, new TestSessionServiceMessageCallback(sessionService));
} catch (Exception e) {
}
SCMessage scMessage = new SCMessage();
scMessage.setSessionInfo("sessionInfo");
sessionService.createSession(10, scMessage, new TestSessionServiceMessageCallback(sessionService));
sessionService.execute(new SCMessage());
sessionService.deleteSession();
} else if (getMethodName() == "execute_messageData1MBArray_returnsTheSameMessageData") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage();
scMessage.setSessionInfo("sessionInfo");
sessionService.createSession(60, scMessage, new TestSessionServiceMessageCallback(sessionService));
SCMessage message = new SCMessage(new byte[TestConstants.dataLength1MB]);
message.setCompressed(false);
sessionService.execute(message);
sessionService.deleteSession();
} else if (getMethodName() == "createSessionExecuteDeleteSession_twice_6MessagesArrive") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage();
scMessage.setSessionInfo("sessionInfo");
sessionService.createSession(60, scMessage, new TestSessionServiceMessageCallback(sessionService));
sessionService.execute(new SCMessage(new byte[128]));
sessionService.deleteSession();
scMessage = new SCMessage();
scMessage.setSessionInfo("sessionInfo");
sessionService.createSession(60, scMessage, new TestSessionServiceMessageCallback(sessionService));
sessionService.execute(new SCMessage(new byte[128]));
sessionService.deleteSession();
} else if (getMethodName() == "echo_waitFor3EchoMessages_5MessagesArrive") {
SCSessionService sessionService = client.newSessionService(TestConstants.sesServiceName1);
SCMessage scMessage = new SCMessage();
scMessage.setSessionInfo("sessionInfo");
sessionService.createSession(1, scMessage, new TestSessionServiceMessageCallback(sessionService));
Thread.sleep(6000);
sessionService.deleteSession();
}
} catch (Exception e) {
LOGGER.error("run", e);
} finally {