Package org.serviceconnector.api

Examples of org.serviceconnector.api.SCMessage


   * Description: Create session to service not served by a server<br>
   * Expectation: throws SCMPValidatorException
   */
  @Test(expected = SCMPValidatorException.class)
  public void t09_createSession() throws Exception {
    SCMessage request = null;
    SCMessage response = null;
    sessionService1 = client.newSessionService(TestConstants.sesServiceName2);
    msgCallback1 = new MsgCallback(sessionService1);
    response = sessionService1.createSession(request, msgCallback1);
  }
View Full Code Here


   * Description: Create session with 60kB message<br>
   * Expectation: passes
   */
  @Test
  public void t50_createSession60kBmsg() throws Exception {
    SCMessage request = new SCMessage(new byte[TestConstants.dataLength60kB]);
    SCMessage response = null;
    sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
    msgCallback1 = new MsgCallback(sessionService1);
    response = sessionService1.createSession(request, msgCallback1);
    Assert.assertNotNull("the session ID is null", sessionService1.getSessionId());
    sessionService1.deleteSession();
View Full Code Here

   * Description: Create session with large message<br>
   * Expectation: throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t51_createSession1MBmsg() throws Exception {
    SCMessage request = new SCMessage(new byte[TestConstants.dataLength1MB]);
    SCMessage response = null;
    sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
    msgCallback1 = new MsgCallback(sessionService1);
    response = sessionService1.createSession(request, msgCallback1);
  }
View Full Code Here

   * Description: Create session twice<br>
   * Expectation: throws SCMPValidatorException
   */
  @Test(expected = SCMPValidatorException.class)
  public void t60_createSessionTwice() throws Exception {
    SCMessage request = null;
    SCMessage response = null;
    sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
    msgCallback1 = new MsgCallback(sessionService1);
    response = sessionService1.createSession(request, msgCallback1);
    Assert.assertNotNull("the session ID is null", sessionService1.getSessionId());

View Full Code Here

   * Description: Create two sessions to the same service<br>
   * Expectation: passes
   */
  @Test
  public void t70_createTwoSessions() throws Exception {
    SCMessage request = new SCMessage();
    SCMessage response = null;
    SCSessionService service1 = client.newSessionService(TestConstants.sesServiceName1);
    SCSessionService service2 = client.newSessionService(TestConstants.sesServiceName1);
    msgCallback1 = new MsgCallback(sessionService1);
    response = service1.createSession(request, msgCallback1);
    Assert.assertNotNull("the session ID is null", service1.getSessionId());
View Full Code Here

   * Description: screw up sessionId before create session<br>
   * Expectation: passes because sessionId is set internally.
   */
  @Test
  public void t80_sessionId() throws Exception {
    SCMessage request = new SCMessage(TestConstants.pangram);
    SCMessage response = null;
    sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
    String sessionId = "aaaa0000-bb11-cc22-dd33-eeeeee444444";
    request.setSessionId(sessionId);
    msgCallback1 = new MsgCallback(sessionService1);
    response = sessionService1.createSession(request, msgCallback1);
    Assert.assertEquals("sessionId is the same", false, sessionId == response.getSessionId());
    sessionService1.deleteSession();
  }
View Full Code Here

   * Description: create session and get sessionInfo from server<br>
   * Expectation: passes
   */
  @Test
  public void t81_sessionInfo() throws Exception {
    SCMessage request = new SCMessage(TestConstants.pangram);
    String sessionInfo = "sessionInfoFromServer";
    request.setSessionInfo(sessionInfo);
    SCMessage response = null;
    sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
    msgCallback1 = new MsgCallback(sessionService1);
    response = sessionService1.createSession(request, msgCallback1);
    Assert.assertEquals("sessionInfo is not the same", sessionInfo, response.getSessionInfo());
    sessionService1.deleteSession();
  }
View Full Code Here

    SCMgmtClient clientMgmt = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP);
    clientMgmt.attach();
    clientMgmt.disableService(TestConstants.sesServiceName1);
    clientMgmt.detach();

    SCMessage request = null;
    SCMessage response = null;
    sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
    msgCallback1 = new MsgCallback(sessionService1);
    response = sessionService1.createSession(request, msgCallback1);
  }
View Full Code Here

   * Description: Reject session by server, check error code<br>
   * Expectation: passes, exception catched
   */
  @Test
  public void t85_rejectSession() throws Exception {
    SCMessage request = new SCMessage();
    SCMessage response = new SCMessage();
    sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
    request.setSessionInfo(TestConstants.rejectCmd);
    Boolean passed = false;
    try {
      msgCallback1 = new MsgCallback(sessionService1);
View Full Code Here

   * Description: Reject session by server<br>
   * Expectation: throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t86_rejectSession() throws Exception {
    SCMessage request = new SCMessage(TestConstants.pangram);
    request.setCompressed(false);
    SCMessage response = null;
    sessionService1 = client.newSessionService(TestConstants.sesServiceName1);
    request.setSessionInfo(TestConstants.rejectCmd);
    msgCallback1 = new MsgCallback(sessionService1);
    response = sessionService1.createSession(request, msgCallback1);
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.api.SCMessage

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.