Examples of ISCMPCall


Examples of org.serviceconnector.call.ISCMPCall

   */
  @Test
  public void t01_GroupCall() throws Exception {
    SCMPClnExecuteCall executeCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    executeCall.setMessageInfo(TestConstants.echoCmd);
    ISCMPCall groupCall = executeCall.openGroup();

    TestCallback cbk = new TestCallback(true);
    groupCall.invoke(cbk, 3000);
    TestUtil.checkReply(cbk.getMessageSync(3000));

    for (int i = 0; i < TestConstants.pangram.length(); i++) {
      cbk = new TestCallback(true);
      groupCall.setRequestBody(TestConstants.pangram.subSequence(i, i + 1));
      groupCall.invoke(cbk, 3000);
      TestUtil.checkReply(cbk.getMessageSync(3000));
    }
    groupCall.closeGroup(cbk, 3000); // send REQ (no body content)
    SCMPMessage res = cbk.getMessageSync(3000);

    Assert.assertEquals(TestConstants.pangram, res.getBody());
    Assert.assertNotNull(res.getMessageSequenceNr());
    Assert.assertEquals(SCMPBodyType.TEXT.getValue(), res.getHeader(SCMPHeaderAttributeKey.BODY_TYPE));
View Full Code Here

Examples of org.serviceconnector.call.ISCMPCall

   */
  @Test
  public void t10_GroupCallLargeRequest() throws Exception {
    SCMPClnExecuteCall executeCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    executeCall.setMessageInfo(TestConstants.echoCmd);
    ISCMPCall groupCall = executeCall.openGroup();

    String largeString = TestUtil.getLargeString();
    groupCall.setRequestBody(largeString);
    TestCallback cbk = new TestCallback(true);
    groupCall.invoke(cbk, 1000);
    SCMPMessage reply = cbk.getMessageSync(1000);
    TestUtil.checkReply(reply);

    cbk = new TestCallback(true);
    groupCall.closeGroup(cbk, 1000); // send REQ (no body content)
    reply = cbk.getMessageSync(3000);

    Assert.assertEquals(largeString.length() + "", reply.getBodyLength() + "");
    Assert.assertEquals(largeString, reply.getBody());
    Assert.assertEquals(SCMPMsgType.CLN_EXECUTE.getValue(), reply.getMessageType());
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.