Package org.serviceconnector.api.srv

Examples of org.serviceconnector.api.srv.SCServer


   * Description:  register session server with 1 session and 1 connection twice<br>
   * Expectation:  throws SCServiceException
   */
  @Test (expected = SCServiceException.class)
  public void t214_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, TestConstants.PORT_SES_SRV_HTTP, ConnectionType.NETTY_HTTP);
    server.startListener();
    sessionServer = server.newSessionServer(TestConstants.sesServiceName1);
    SCSessionServerCallback cbk = new SesSrvCallback(sessionServer);
    sessionServer.register(1, 1, cbk);
    sessionServer.register(1, 1, cbk);
View Full Code Here


   * Description:  register session server before listener is started<br>
   * Expectation:  throws SCServiceException
   */
  @Test (expected = SCServiceException.class)
  public void t215_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, TestConstants.PORT_SES_SRV_HTTP, ConnectionType.NETTY_HTTP);
    sessionServer = server.newSessionServer(TestConstants.sesServiceName1);
    SCSessionServerCallback cbk = new SesSrvCallback(sessionServer);
    sessionServer.register(1, 1, cbk);
    server.startListener();
  }
View Full Code Here

   * Description:  register /de-register session server with 1 session and 1 connection 1000 times<br>
   * Expectation:  passes
   */
  @Test
  public void t216_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, TestConstants.PORT_SES_SRV_HTTP, ConnectionType.NETTY_HTTP);
    server.startListener();
    sessionServer = server.newSessionServer(TestConstants.sesServiceName1);
    SCSessionServerCallback cbk = new SesSrvCallback(sessionServer);
    int nr = 1000;
    int sleep = 0;
View Full Code Here

   * Description:  register two session servers to two services with two callbacks<br>
   * Expectation:  passes
   */
  @Test
  public void t298_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, TestConstants.PORT_SES_SRV_HTTP, ConnectionType.NETTY_HTTP);
    server.startListener();
    SCSessionServer sessionServer1 = server.newSessionServer(TestConstants.sesServiceName1);
    SCSessionServerCallback cbk1 = new SesSrvCallback(sessionServer1);
    sessionServer1.register(1, 1, cbk1);
    Assert.assertEquals("SessionServer is not registered", true, sessionServer1.isRegistered());
View Full Code Here

   * Description:  register two session servers to two services with same callback<br>
   * Expectation:  passes
   */
  @Test
  public void t299_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_HTTP, TestConstants.PORT_SES_SRV_HTTP, ConnectionType.NETTY_HTTP);
    server.startListener();
    SCSessionServer sessionServer1 = server.newSessionServer(TestConstants.sesServiceName1);
    SCSessionServerCallback cbk = new SesSrvCallback(sessionServer1);
    sessionServer1.register(1, 1, cbk);
    Assert.assertEquals("SessionServer is not registered", true, sessionServer1.isRegistered());
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(0);
      sc.setKeepAliveIntervalSeconds(10);
      sc.setCheckRegistrationIntervalSeconds(40);
      sc.setImmediateConnect(true);
      sc.startListener();

      String[] serviceNames = this.serviceNames.split(",");
      for (String serviceName : serviceNames) {
        SCPublishServer server = sc.newPublishServer(serviceName);
        SCPublishServerCallback cbk = new SrvCallback(server);
        try {
          server.register(10, this.maxSessions, this.maxConnections, cbk);
        } catch (Exception e) {
          LOGGER.error("runPublishServer", 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_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer(TestConstants.pubServiceName1);
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(1, 1, cbk);
  }
View Full Code Here

   * Description:  register session server with no service name<br>
   * Expectation:  throws SCMPValidatorException
   */
  @Test (expected = SCMPValidatorException.class)
  public void t102_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer(null);
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(1, 1, cbk);
  }
View Full Code Here

   * Description:  register session server with service name = ""<br>
   * Expectation:  throws SCServiceException
   */
  @Test (expected = SCServiceException.class)
  public void t103_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer("");
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(1, 1, cbk);
  }
View Full Code Here

   * Description:  register session server with service name = " "<br>
   * Expectation:  throws SCServiceException
   */
  @Test (expected = SCServiceException.class)
  public void t104_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer(" ");
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.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.