Package org.serviceconnector.call

Examples of org.serviceconnector.call.SCMPClnExecuteCall


   * Description: execute - waits 2 seconds, OTI runs out on SC<br>
   * Expectation: passes
   */
  @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


   * Expectation: throws parallel request error
   */
  @Test
  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);
View Full Code Here

   * Description: execute - exception on server - hand over to client<br>
   * Expectation: passes
   */
  @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

   * Description: execute small request - large response both uncompressed, cached<br>
   * Expectation: passes
   */
  @Test
  public void t40_SmallRequestLargeResponseUncompressed() throws Exception {
    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

   * Description: execute large request - small response both uncompressed, cached<br>
   * Expectation: passes
   */
  @Test
  public void t41_LargeRequestSmallResponseUncompressed() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    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

   * Description: execute large request - large response both uncompressed, cached<br>
   * Expectation: passes
   */
  @Test
  public void t42_LargeRequestLargeResponseUncompressed() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    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

   * Description: execute small request - 10MB response both uncompressed, cached<br>
   * Expectation: passes
   */
  @Test
  public void t43_SmallRequest10MBResponseUncompressed() throws Exception {
    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

   * Description: execute small request - no cache id set by server, no caching of message<br>
   * Expectation: passes
   */
  @Test
  public void t45_NoCacheIdSetByServer() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("700");
    clnExecuteCall.setRequestBody("noCid");
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("700", "checkCacheContent");
  }
View Full Code Here

   * Description: execute small request - different cache id set by server, no caching of message<br>
   * Expectation: passes
   */
  @Test
  public void t46_DifferentCacheIdSetByServer() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("700");
    clnExecuteCall.setRequestBody("cacheServerReplyOther");
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("700", "checkCacheContent");
  }
View Full Code Here

   * Description: execute small request - no cache expiration date set by server, no caching of message<br>
   * Expectation: passes
   */
  @Test
  public void t47_NOCacheExpirationDateSetByServer() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("700");
    clnExecuteCall.setRequestBody("cidNoCed");
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("700", "checkCacheContent");
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.call.SCMPClnExecuteCall

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.