Package org.serviceconnector.call

Examples of org.serviceconnector.call.SCMPClnCreateSessionCall.invoke()


  public void t04_ServiceNameBlank() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.getRequest().setServiceName(" ");
    createSessionCall.setEchoIntervalSeconds(300);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 1000);
    SCMPMessage fault = cbk.getMessageSync(3000);
    Assert.assertTrue(fault.isFault());
    TestUtil.verifyError(fault, SCMPError.HV_WRONG_SERVICE_NAME, SCMPMsgType.CLN_CREATE_SESSION);
  }
View Full Code Here


        break;
    }
    createSessionCall.getRequest().setServiceName(sb.toString());
    createSessionCall.setEchoIntervalSeconds(300);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 1000);
    SCMPMessage fault = cbk.getMessageSync(3000);
    Assert.assertTrue(fault.isFault());
    TestUtil.verifyError(fault, SCMPError.HV_WRONG_SERVICE_NAME, SCMPMsgType.CLN_CREATE_SESSION);
  }
View Full Code Here

  public void t06_NonExistingServiceName() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.getRequest().setServiceName("Gaga");
    createSessionCall.setEchoIntervalSeconds(300);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 1000);
    SCMPMessage fault = cbk.getMessageSync(3000);
    Assert.assertTrue(fault.isFault());
    TestUtil.verifyError(fault, SCMPError.SERVICE_NOT_FOUND, SCMPMsgType.CLN_CREATE_SESSION);
  }
}
View Full Code Here

  private SCMPMessage clnCreateSession() throws Exception {
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
    createSessionCall.setSessionInfo("sessionInfo");
    createSessionCall.setEchoIntervalSeconds(3600);
    TestCallback cbk = new TestCallback();
    createSessionCall.invoke(cbk, 1000);
    return cbk.getMessageSync(3000);
  }
}
View Full Code Here

    createSessionCall.setCompressed(scMessage.isCompressed());
    createSessionCall.setSessionInfo(scMessage.getSessionInfo());
    createSessionCall.setEchoIntervalSeconds(this.echoIntervalSeconds);
    SCServiceCallback callback = new SCServiceCallback(true);
    try {
      createSessionCall.invoke(callback, operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
    } catch (Exception e) {
      throw new SCServiceException("Create session failed. ", e);
    }
    // 3. receiving reply and error handling
    SCMPMessage reply = callback.getMessageSync(operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
 
View Full Code Here

    // 2. initialize call & invoke
    SCServiceCallback callback = new SCServiceCallback(true);
    SCMPClnCreateSessionCall createSessionCall = new SCMPClnCreateSessionCall(this.requester, this.serviceName);
    createSessionCall.setEchoIntervalSeconds(this.echoIntervalSeconds);
    try {
      createSessionCall.invoke(callback, operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
    } catch (Exception e) {
      throw new SCServiceException("Create file session on SC failed. ", e);
    }
    // 3. receiving reply and error handling
    SCMPMessage reply = callback.getMessageSync(operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
 
View Full Code Here

    // 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

  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

  private 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, 1000);
    SCMPMessage resp = cbk.getMessageSync(3000);
    this.sessionId = resp.getSessionId();
  }

  /**
 
View Full Code Here

    // 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();

    // create another session3
    createSessionCall = new SCMPClnCreateSessionCall(this.requester, TestConstants.sesServerName1);
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.