Package org.serviceconnector.call

Examples of org.serviceconnector.call.SCMPClnExecuteCall


   * 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, 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", "cidNoCed");
  }
View Full Code Here

   * Description: execute small request - cache for 2 seconds wait until expiration than try to load<br>
   * Expectation: passes
   */
  @Test
  public void t48_TryLoadingExpiredMessage() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("700");
    clnExecuteCall.setRequestBody("cacheFor2Sec");
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    Thread.sleep(2000);
    this.checkCacheContent("700", "checkCacheContent");
  }
View Full Code Here

   * Description: execute small request - cache for 2 seconds wait until expiration than try to load, load cachid again for 1 hour<br>
   * Expectation: passes
   */
  @Test
  public void t49_TryLoadingExpiredMessageLoadAgain() throws Exception {
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("700");
    clnExecuteCall.setRequestBody("cacheFor2Sec");
    clnExecuteCall.setCompressed(false);
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    Thread.sleep(3000);
    this.checkCacheContent("700", "checkCacheContent");
    clnExecuteCall.setRequestBody("cacheFor1Hour");
    clnExecuteCall.invoke(cbk, 3000);
    cbk.getMessageSync(3000);
    this.checkCacheContent("700", "cacheFor1Hour");
  }
View Full Code Here

   */
  @Test
  public void t70_2ClientsLoadingCacheError() throws Exception {

    // reserve connection 1 with standard session
    SCMPClnExecuteCall clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, this.sessionId);
    clnExecuteCall.setMessageInfo(TestConstants.sleepCmd);
    clnExecuteCall.setRequestBody("3000");
    clnExecuteCall.setCacheId("700");
    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);
    TestCallback cbk2 = new TestCallback();
    createSessionCall.invoke(cbk2, 3000);
    SCMPMessage resp = cbk2.getMessageSync(3000);
    String sessionId2 = resp.getSessionId();

    // reserve connection 2 with session2
    clnExecuteCall = new SCMPClnExecuteCall(this.requester, TestConstants.sesServerName1, sessionId2);
    clnExecuteCall.setMessageInfo(TestConstants.sleepCmd);
    clnExecuteCall.setRequestBody("3000");
    clnExecuteCall.setCacheId("700");
    TestCallback cbk4 = new TestCallback();
    clnExecuteCall.invoke(cbk4, 10000);
    SCMPMessage reply = cbk4.getMessageSync(4000);
    TestUtil.verifyError(reply, SCMPError.CACHE_LOADING, SCMPMsgType.CLN_EXECUTE);
    TestUtil.checkReply(cbk.getMessageSync(4000));
  }
View Full Code Here

   * 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.setRequestBody("cacheTimeoutReply");
    clnExecuteCall.setMessageInfo(TestConstants.cacheCmd);
    clnExecuteCall.setCacheId("700");
    TestCallback cbk = new TestCallback();
    clnExecuteCall.invoke(cbk, 1000);
    SCMPMessage responseMessage = cbk.getMessageSync(1000);
    TestUtil.verifyError(responseMessage, SCMPError.OPERATION_TIMEOUT, SCMPMsgType.CLN_EXECUTE);
    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.