Package org.serviceconnector.call

Examples of org.serviceconnector.call.SCMPClnCreateSessionCall


    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);
View Full Code Here


   *
   * @throws Exception
   *             the exception
   */
  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

   * Description: create session - delete session<br>
   * Expectation: passes
   */
  @Test
  public void t10_CreateSessionDeleteSession() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3000);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 2000);
    SCMPMessage responseMessage = cbk.getMessageSync(4000);
    String sessId = responseMessage.getSessionId();
    TestUtil.checkReply(responseMessage);

    SCMPClnDeleteSessionCall deleteSessionCall = new SCMPClnDeleteSessionCall(this.requester, responseMessage.getServiceName(),
View Full Code Here

   * Description: create session - session gets rejected<br>
   * Expectation: passes, returns rejection
   */
  @Test
  public void t20_SessionRejected() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo(TestConstants.rejectCmd);
    createSessionCall.setEchoIntervalSeconds(300);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 4000);
    SCMPMessage responseMessage = cbk.getMessageSync(3000);
    String sessId = responseMessage.getSessionId();
    Assert.assertNull(sessId);
    Assert.assertFalse(responseMessage.isFault());
    Assert.assertTrue(responseMessage.getHeaderFlag(SCMPHeaderAttributeKey.REJECT_SESSION));
View Full Code Here

   * Description: create session - wait until session times out<br>
   * Expectation: passes, returns error
   */
  @Test
  public void t30_SessionTimesOut() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(10);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 4000);
    SCMPMessage responseMessage = cbk.getMessageSync(3000);
    TestUtil.checkReply(responseMessage);

    String sessionId = responseMessage.getSessionId();
    // wait until session times out and get cleaned up
View Full Code Here

   * waiting for free connection<br>
   * Expectation: passes
   */
  @Test
  public void t35_WaitsForConnectionTimeout() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo(TestConstants.sleepCmd);
    createSessionCall.setEchoIntervalSeconds(10);
    createSessionCall.setRequestBody("3000");
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 10000);

    createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo(TestConstants.sleepCmd);
    createSessionCall.setEchoIntervalSeconds(10);
    createSessionCall.setRequestBody("3000");
    TestCallback cbk1 = new TestCallback();
    createSessionCall.invoke(cbk1, 10000);

    // to assure second create is not faster
    Thread.sleep(200);
    createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setEchoIntervalSeconds(10);
    TestCallback cbk2 = new TestCallback();
    createSessionCall.invoke(cbk2, 2000);

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

View Full Code Here

TOP

Related Classes of org.serviceconnector.call.SCMPClnCreateSessionCall

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.