Package org.serviceconnector.api.cln

Examples of org.serviceconnector.api.cln.SCMgmtClient


   * Description: getWorkload after SC was aborted<br>
   * Expectation:  throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t105_getWorkloadAfterAbort() throws Exception {
    client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
    client.attach();
    Assert.assertEquals("Client is not attached", true, client.isAttached());
   
    ctrl.stopSC(scCtx);
   
View Full Code Here


   * Description: attach after SC was aborted<br>
   * Expectation:  throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t201_attachAfterAbort() throws Exception {
    client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, ConnectionType.NETTY_HTTP);
   
    ctrl.stopSC(scCtx);
   
    client.attach();
  }
View Full Code Here

   * Description: detach after SC was aborted<br>
   * Expectation:  throws SCServiceException
   */
  @Test (expected = SCServiceException.class)
  public void t202_detachAfterAbort() throws Exception {
    client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, ConnectionType.NETTY_HTTP);
    client.attach();
    Assert.assertEquals("Client is not attached", true, client.isAttached());
   
    ctrl.stopSC(scCtx);
   
View Full Code Here

   * Description: enable service after SC was aborted<br>
   * Expectation:  throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t203_enableServiceAfterAbort() throws Exception {
    client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, ConnectionType.NETTY_HTTP);
    client.attach();
    Assert.assertEquals("Client is not attached", true, client.isAttached());
   
    ctrl.stopSC(scCtx);
   
View Full Code Here

   * Description: disable service after SC was aborted<br>
   * Expectation:  throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t204_disableServiceAfterAbort() throws Exception {
    client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, ConnectionType.NETTY_HTTP);
    client.attach();
    Assert.assertEquals("Client is not attached", true, client.isAttached());
   
    ctrl.stopSC(scCtx);
   
View Full Code Here

   * Description: getWorkload after SC was aborted<br>
   * Expectation:  throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t205_getWorkloadAfterAbort() throws Exception {
    client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, ConnectionType.NETTY_HTTP);
    client.attach();
    Assert.assertEquals("Client is not attached", true, client.isAttached());
   
    ctrl.stopSC(scCtx);
   
View Full Code Here

    APISystemSuperCCTest.setUp1CascadedServiceConnectorAndServer();
  }

  public void setUpClientToSC() throws Exception {
    if (cascadingLevel == 0) {
      mgmtClient = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
      guardianClient = new SCClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
      sessionClient = new SCClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
    } else if (cascadingLevel == 1) {
      mgmtClient = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC1_TCP, ConnectionType.NETTY_TCP);
      guardianClient = new SCClient(TestConstants.HOST, TestConstants.PORT_SC1_TCP, ConnectionType.NETTY_TCP);
      sessionClient = new SCClient(TestConstants.HOST, TestConstants.PORT_SC1_TCP, ConnectionType.NETTY_TCP);
    } else if (cascadingLevel == 2) {
      mgmtClient = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC2_TCP, ConnectionType.NETTY_TCP);
      guardianClient = new SCClient(TestConstants.HOST, TestConstants.PORT_SC2_TCP, ConnectionType.NETTY_TCP);
      sessionClient = new SCClient(TestConstants.HOST, TestConstants.PORT_SC2_TCP, ConnectionType.NETTY_TCP);
    }
    mgmtClient.attach();
    guardianClient.attach();
View Full Code Here

  }
 
  public void setUpClientToSC() throws Exception {
    if (client == null) {  // client may be already created and attached because the of the class hierarchy
      if (cascadingLevel == 0) {
        client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
        client.attach();
      } else if (cascadingLevel == 1) {
        client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC1_TCP, ConnectionType.NETTY_TCP);
        client.attach();
      } else if (cascadingLevel == 2) {
        client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC2_TCP, ConnectionType.NETTY_TCP);
        client.attach();
      }
    }
  }
View Full Code Here

   * @throws Exception
   *             the exception
   */
  @Test
  public void t50_enable_disable_command() throws Exception {
    SCMgmtClient client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
    client.attach();
    try {
      SCConsole.main(new String[] { "-h", TestConstants.HOST, "-p", String.valueOf(TestConstants.PORT_SC0_TCP),
          Constants.CC_CMD_DISABLE + "?serviceName=" + TestConstants.sesServiceName1 });
    } catch (ExitException e) {
      Assert.assertEquals(0, e.status);
    }
    Assert.assertFalse(client.isServiceEnabled(TestConstants.sesServiceName1));
    try {
      SCConsole.main(new String[] { "-h", TestConstants.HOST, "-p", String.valueOf(TestConstants.PORT_SC0_TCP),
          Constants.CC_CMD_ENABLE + "?serviceName=" + TestConstants.sesServiceName1 });
    } catch (ExitException e) {
      Assert.assertEquals(0, e.status);
    }
    Assert.assertTrue(client.isServiceEnabled(TestConstants.sesServiceName1));
    client.detach();
  }
View Full Code Here

   * @throws Exception
   *             the exception
   */
  @Test
  public void t51_enable_disable_wildCard_command() throws Exception {
    SCMgmtClient client = new SCMgmtClient(TestConstants.HOST, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
    client.attach();
    try {
      SCConsole.main(new String[] { "-h", TestConstants.HOST, "-p", String.valueOf(TestConstants.PORT_SC0_TCP),
          Constants.CC_CMD_DISABLE + "?serviceName=.*" });
    } catch (ExitException e) {
      Assert.assertEquals(0, e.status);
    }
    Assert.assertFalse(client.isServiceEnabled(TestConstants.sesServiceName1));
    try {
      SCConsole.main(new String[] { "-h", TestConstants.HOST, "-p", String.valueOf(TestConstants.PORT_SC0_TCP),
          Constants.CC_CMD_ENABLE + "?serviceName=.*" });
    } catch (ExitException e) {
      Assert.assertEquals(0, e.status);
    }
    Assert.assertTrue(client.isServiceEnabled(TestConstants.sesServiceName1));
    client.detach();
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.api.cln.SCMgmtClient

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.