Package test.shell.base

Examples of test.shell.base.BaseProcessFactory


    latch.await(5, TimeUnit.SECONDS);
    assertEquals(Collections.singletonList("ab"), requests);
  }

  public void testCLS() throws Exception {
    Controller controller = create(new BaseShell(new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          public void process(String request, ShellProcessContext processContext) throws IOException {
View Full Code Here


    //
    controller.assertStop();
  }

  public void testFlush() throws Exception {
    Controller controller = create(new BaseShell(new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          public void process(String request, ShellProcessContext processContext) throws IOException {
View Full Code Here

    t.interrupt();
    assertJoin(t);
  }

  public void testExecute() throws Exception {
    ClientProcessor t = new ClientProcessor(clientOIS, clientOOS, new BaseShell(new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          public void process(String request, ShellProcessContext processContext) throws IOException {
View Full Code Here

    t.interrupt();
    assertJoin(t);
  }

  public void testClose() throws Exception {
    ClientProcessor t = new ClientProcessor(clientOIS, clientOOS, new BaseShell(new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          protected ShellResponse execute(String request) {
View Full Code Here

    //
    assertJoin(t);
  }

  public void testRawClose() throws Exception {
    ClientProcessor t = new ClientProcessor(clientOIS, clientOOS, new BaseShell(new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          protected ShellResponse execute(String request) {
View Full Code Here

  public void testExceptionDuringRequest() throws Exception {

    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicReference<RuntimeException> ex = new AtomicReference<RuntimeException>();

    ClientProcessor t = new ClientProcessor(clientOIS, clientOOS, new BaseShell(new BaseProcessFactory() {
      int count = 0;
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
View Full Code Here

    final AtomicBoolean waiting = new AtomicBoolean();
    final CountDownLatch latch = new CountDownLatch(1);

    //
    ClientProcessor t = new ClientProcessor(clientOIS, clientOOS, new BaseShell(new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          public void process(String request, final ShellProcessContext processContext) throws IOException {
View Full Code Here

  }

  public void testReadLine() throws Exception {

    //
    BaseProcessFactory factory = new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          public void process(String request, ShellProcessContext processContext) throws IOException {
View Full Code Here

    final AtomicReference<Throwable> failure = new AtomicReference<Throwable>();
    final CountDownLatch latch1 = new CountDownLatch(1);
    final CountDownLatch latch2 = new CountDownLatch(1);

    //
    BaseProcessFactory factory = new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          protected ShellResponse execute(String request) {
View Full Code Here

  public void testEvaluating() throws Exception {
    final AtomicReference<Throwable> failure = new AtomicReference<Throwable>();
    final AtomicInteger cancelCount = new AtomicInteger(0);

    //
    BaseProcessFactory factory = new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          protected ShellResponse execute(String request) {
View Full Code Here

TOP

Related Classes of test.shell.base.BaseProcessFactory

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.