Package org.serviceconnector.call

Examples of org.serviceconnector.call.SCMPClnExecuteCall.invoke()


    String largeString = TestUtil.getLargeString();
    clnExecuteCall.setMessageInfo(TestConstants.largeResponseCmd);
    clnExecuteCall.setRequestBody(largeString);
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    SCMPMessage scmpReply = cbk.getMessageSync(3000);
    Assert.assertEquals(largeString.length() + "", scmpReply.getBodyLength() + "");
    Assert.assertEquals(largeString, scmpReply.getBody());
    Assert.assertEquals(SCMPBodyType.TEXT.getValue(), scmpReply.getHeader(SCMPHeaderAttributeKey.BODY_TYPE));
    Assert.assertEquals(SCMPMsgType.CLN_EXECUTE.getValue(), scmpReply.getMessageType());
View Full Code Here


  public void t50_SmallRequestLargeResponseCompressed() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.largeResponseCmd);
    clnExecuteCall.setRequestBody("test body");
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    SCMPMessage scmpReply = cbk.getMessageSync(3000);

    String expectedResponse = TestUtil.getLargeString();
    Assert.assertEquals(expectedResponse.length(), scmpReply.getBodyLength());
    Assert.assertEquals(expectedResponse, scmpReply.getBody());
View Full Code Here

    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.largeResponse10MBCmd);
    clnExecuteCall.setRequestBody("test body");
    clnExecuteCall.setCompressed(true);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 300000);
    SCMPMessage scmpReply = cbk.getMessageSync(300000);

    String expectedResponse = TestUtil.get10MBString();
    Assert.assertEquals("unequal length", expectedResponse.length(), scmpReply.getBodyLength());
    Assert.assertEquals(expectedResponse, scmpReply.getBody());
View Full Code Here

  public void t52_LargeRequestSmallResponseCompressed() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    String largeString = TestUtil.getLargeString();
    clnExecuteCall.setRequestBody(largeString);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    SCMPMessage scmpReply = cbk.getMessageSync(3000);
    Assert.assertNotNull(scmpReply.getSessionId());
    Assert.assertEquals(0, scmpReply.getBodyLength());
    Assert.assertEquals(null, scmpReply.getBody());
  }
View Full Code Here

    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    String largeString = TestUtil.getLargeString();
    clnExecuteCall.setMessageInfo(TestConstants.largeResponseCmd);
    clnExecuteCall.setRequestBody(largeString);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    SCMPMessage scmpReply = cbk.getMessageSync(3000);
    Assert.assertEquals(largeString.length() + "", scmpReply.getBodyLength() + "");
    Assert.assertEquals(largeString, scmpReply.getBody());
    Assert.assertEquals(SCMPBodyType.TEXT.getValue(), scmpReply.getHeader(SCMPHeaderAttributeKey.BODY_TYPE));
    Assert.assertEquals(SCMPMsgType.CLN_EXECUTE.getValue(), scmpReply.getMessageType());
View Full Code Here

    // reserve connection 1 with standard session
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.sleepCmd);
    clnExecuteCall.setRequestBody("3000");
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 10000);

    // create another session2
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
View Full Code Here

    // reserve connection 2 with session2
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, sessionId3);
    clnExecuteCall.setMessageInfo(TestConstants.sleepCmd);
    clnExecuteCall.setRequestBody("3000");
    TestCallback cbk4 = new TestCallback();
    clnExecuteCall.invoke(cbk4, 10000);

    // to assure second create is not faster
    Thread.sleep(20);
    // try to get a third connection with a third session - should not work
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, sessionId2);
View Full Code Here

    // to assure second create is not faster
    Thread.sleep(20);
    // try to get a third connection with a third session - should not work
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, sessionId2);
    TestCallback cbk5 = new TestCallback();
    clnExecuteCall.invoke(cbk5, 2000);

    SCMPMessage reply = cbk4.getMessageSync(4000);
    SCMPMessage reply1 = cbk5.getMessageSync(4000);

    TestUtil.checkReply(reply);
View Full Code Here

    // reserve connection 1 with standard session
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.sleepCmd);
    clnExecuteCall.setRequestBody("3000");
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 10000);

    // create another session2
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
View Full Code Here

    // reserve connection 2 with session2
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, sessionId3);
    clnExecuteCall.setMessageInfo(TestConstants.sleepCmd);
    clnExecuteCall.setRequestBody("3000");
    TestCallback cbk4 = new TestCallback();
    clnExecuteCall.invoke(cbk4, 10000);

    // to assure second create is not faster
    Thread.sleep(20);
    // try to get a third connection with a third session - should work with the wait mec for free connections
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, sessionId2);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.