Package org.serviceconnector.api.srv

Examples of org.serviceconnector.api.srv.SCServer


   * Description: SCServer with port = MAX <br>
   * Expectation: passes
   */
  @Test
  public void t13_constructor() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_MAX, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
    Assert.assertEquals("Host not equal", TestConstants.HOST, server.getSCHost());
    Assert.assertEquals("Port not equal", TestConstants.PORT_MAX, server.getSCPort());
    Assert.assertEquals("Listener Port not equal", TestConstants.PORT_SC0_TCP, server.getListenerPort());
    Assert.assertEquals("Connection Type not equal", ConnectionType.NETTY_TCP, server.getConnectionType());
    Assert.assertNotNull(server);
View Full Code Here


   * Description: SCServer with port = MAX + 1 <br>
   * Expectation: throws SCMPValidatorException
   */
  @Test(expected = SCMPValidatorException.class)
  public void t14_constructor() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_MAX + 1, TestConstants.PORT_SC0_TCP, ConnectionType.NETTY_TCP);
    Assert.assertEquals("Host not equal", TestConstants.HOST, server.getSCHost());
    Assert.assertEquals("Port not equal", TestConstants.PORT_MAX + 1, server.getSCPort());
    Assert.assertEquals("Listener Port not equal", TestConstants.PORT_SC0_TCP, server.getListenerPort());
    Assert.assertEquals("Connection Type not equal", ConnectionType.NETTY_TCP, server.getConnectionType());
    Assert.assertNotNull(server);
View Full Code Here

   * Description: Set KeepAliveInterval with valid value. <br>
   * Expectation: KeepAliveInterval was set
   */
  @Test
  public void t60_KeepAliveInterval() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_SES_SRV_TCP,
        ConnectionType.NETTY_TCP);
    server.setKeepAliveIntervalSeconds(10);
    Assert.assertEquals("KeepAliveInterval not equal", 10, server.getKeepAliveIntervalSeconds());
    Assert.assertNotNull(server);
    server.startListener();
View Full Code Here

   * Description: Set KeepAliveInterval with invalid value. <br>
   * Expectation: throws SCMPCommunicationException
   */
  @Test
  public void t61_KeepAliveInterval() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_SES_SRV_TCP,
        ConnectionType.NETTY_TCP);
    server.setKeepAliveIntervalSeconds(-1);
    Assert.assertEquals("KeepAliveInterval not equal", -1, server.getKeepAliveIntervalSeconds());
    Assert.assertNotNull(server);
    server.startListener();
View Full Code Here

   * Description: Set ImmediateConnect with valid value. <br>
   * Expectation: ImmediateConnect was set
   */
  @Test
  public void t70_ImmediateConnect() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_SES_SRV_TCP,
        ConnectionType.NETTY_TCP);
    Assert.assertEquals("ImmediateConnect not equal", false, server.isImmediateConnect());
    server.setImmediateConnect(true);
    Assert.assertEquals("ImmediateConnect not equal", true, server.isImmediateConnect());
    server.setImmediateConnect(false);
View Full Code Here

   * Description: Start and stop Listener. <br>
   * Expectation: Listener is stopped
   */
  @Test
  public void t80_Listener() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_SES_SRV_TCP,
        ConnectionType.NETTY_TCP);
    Assert.assertNotNull("server exists", server);
    server.startListener();
    Assert.assertEquals("Listener is not running", true, server.isListening());
    server.stopListener();
View Full Code Here

   * Description: Start and stop Listener 100 times. <br>
   * Expectation: Listener is stopped
   */
  @Test
  public void t81_Listener() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_SES_SRV_TCP,
        ConnectionType.NETTY_TCP);
    Assert.assertNotNull("server exists", server);
    int nr = 100;
    int sleep = 0;
    for (int i = 0; i < nr; i++) {
View Full Code Here

  private SCServer server;
 
  @Before
  public void beforeOneTest() throws Exception {
    super.beforeOneTest();
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_SES_SRV_TCP);
    server.startListener();
  }
View Full Code Here

    String[] nicsStrings = this.nicsStrings.split(",");
    for (String nicString : nicsStrings) {
      nics.add(nicString);
    }

    SCServer sc = new SCServer(TestConstants.HOST, this.port, nics, this.listenerPort, this.connectionType);
    try {
      sc.setKeepAliveIntervalSeconds(10);
      sc.setCheckRegistrationIntervalSeconds(10);
      sc.setImmediateConnect(true);
      sc.startListener();

      String[] serviceNames = this.serviceNames.split(",");
      for (String serviceName : serviceNames) {
        SCSessionServer server = sc.newSessionServer(serviceName);
        SCSessionServerCallback cbk = new SrvCallback(server);
        try {
          server.register(10, this.maxSessions, this.maxConnections, cbk);
        } catch (Exception e) {
          LOGGER.error("runSessionServer", e);
View Full Code Here

   * Description:  register session server on port SC is not listening<br>
   * Expectation:  throws SCServiceException
   */
  @Test (expected = SCServiceException.class)
  public void t101_register() throws Exception {
    server = new SCServer(TestConstants.HOST, 9002, TestConstants.PORT_SES_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    sessionServer = server.newSessionServer(TestConstants.sesServiceName1);
    SCSessionServerCallback cbk = new SesSrvCallback(sessionServer);
    sessionServer.register(1, 1, cbk);
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.api.srv.SCServer

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.