Package com.cisco.server

Examples of com.cisco.server.ServerService


  }

  @Test
  public void testStartConcurrentStartcancel() throws InterruptedException {
    for (int i = 1; i < NTRIALS; i++) {
      final ServerService server = new ServerService(serverConfiguration, processorTaskFactory);
      new Thread(new Runnable() {

        @Override
        public void run() {
          server.call();

        }
      }).start();
      sleep();
      server.cancel();
      assertTrue(server.isStopped());
    }

  }
View Full Code Here


    Thread.sleep(SLEEP_DEFAULT);
  }

  @Test
  public void testStartExceptionCleanup() throws InterruptedException {
    final ServerService server = new ServerService(serverConfiguration, processorTaskFactory);
    boolean gotException = false;
    // start in 1st thread
    new Thread(new Runnable() {

      @Override
      public void run() {
        server.call();

      }
    }).start();
    sleep();
    // start in 2nd thread
    try {
      server.call();

    } catch (IllegalStateException e) {
      gotException = true;
    }
    assertTrue(gotException);// should throw an exception
    server.cancel();
    assertTrue(server.isStopped());

  }
View Full Code Here

  }

  @Test(expected = IllegalStateException.class)
  public void testStopcall() {
    ServerService server = new ServerService(serverConfiguration, processorTaskFactory);
    server.cancel();

  }
View Full Code Here

  }

  @Test(expected = IllegalStateException.class)
  public void testStopState() {
    ServerService server = new ServerService(serverConfiguration, processorTaskFactory);
    server.cancel();

  }
View Full Code Here

TOP

Related Classes of com.cisco.server.ServerService

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.