Package org.serviceconnector

Examples of org.serviceconnector.TestCallback


  @Test
  public void t80_OTITimesOut() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.sleepCmd);
    clnExecuteCall.setRequestBody("2000");
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 2000);
    SCMPMessage responseMessage = cbk.getMessageSync(2000);
    TestUtil.verifyError(responseMessage, SCMPError.OPERATION_TIMEOUT, SCMPMsgType.CLN_EXECUTE);
  }
View Full Code Here


  public void t81_PendingRequestError() throws Exception {

    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.sleepCmd);
    clnExecuteCall.setRequestBody("3000");
    TestCallback cbk2 = new TestCallback();
    clnExecuteCall.invoke(cbk2, 10000);

    // to assure second create is not faster
    Thread.sleep(20);
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    TestCallback cbk1 = new TestCallback();
    clnExecuteCall.invoke(cbk1, 2000);

    SCMPMessage reply = cbk2.getMessageSync(4000);
    SCMPMessage reply1 = cbk1.getMessageSync(4000);

    TestUtil.checkReply(reply);
    Assert.assertTrue(reply1.isFault());
    TestUtil.verifyError(reply1, SCMPError.PARALLEL_REQUEST, SCMPMsgType.CLN_EXECUTE);
  }
View Full Code Here

   */
  protected void createSession() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 3000);
    SCMPMessage resp = cbk.getMessageSync(3000);
    this.sessionId = resp.getSessionId();
  }
View Full Code Here

   *             the exception
   */
  private void deleteSession() throws Exception {
    SCMPClnDeleteSessionCall deleteSessionCall = new SCMPClnDeleteSessionCall(this.requester, TestConstants.sesServerName1,
        this.sessionId);
    TestCallback cbk = new TestCallback();
    deleteSessionCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
  }
View Full Code Here

    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setRequestBody(TestConstants.stringLength257);
    clnExecuteCall.setCompressed(false);
    clnExecuteCall.setCacheId("700");
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("700", TestConstants.stringLength257);
  }
View Full Code Here

  @Test
  public void t20_EXCOnServer() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.raiseExceptionCmd);
    clnExecuteCall.setCacheId("700");
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("700", "checkCacheContent");
  }
View Full Code Here

    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("700");
    clnExecuteCall.setRequestBody("cacheLargeMessageFor1Hour");
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("700", TestUtil.getLargeString());
  }
View Full Code Here

    String largeString = TestUtil.getLargeString();
    clnExecuteCall.setRequestBody(largeString);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("999");
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("999", "large request small response - 999 is a key for that!");
  }
View Full Code Here

    String largeString = TestUtil.getLargeString();
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("666");
    clnExecuteCall.setRequestBody(largeString);
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("666", largeString);
  }
View Full Code Here

    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("700");
    clnExecuteCall.setRequestBody("cache10MBStringFor1Hour");
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 30000);
    cbk.getMessageSync(30000);
    this.checkCacheContent("700", TestUtil.get10MBString());
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.TestCallback

Copyright © 2018 www.massapicom. 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.