Package org.crsh.shell

Examples of org.crsh.shell.ShellProcessContext.end()


    console.on(KeyStrokes.ENTER);
    console.on(KeyStrokes.of("a"));
    console.on(KeyStrokes.INTERRUPT);
    latch.await();
    ShellProcessContext context = contexts.poll(1, TimeUnit.SECONDS);
    context.end(ShellResponse.ok());
    assertEquals("a", getCurrentLine());
    assertEquals(1, getCurrentCursor());
  }
}
View Full Code Here


      @Override
      public void run(String request, ShellProcessContext context) throws Exception {
        contexts.add(context);
      }
    });
    context.end(ShellResponse.ok());
    context = contexts.poll();
    assertNotNull(context);
    context.end(ShellResponse.ok());
  }
View Full Code Here

      }
    });
    context.end(ShellResponse.ok());
    context = contexts.poll();
    assertNotNull(context);
    context.end(ShellResponse.ok());
  }

  public void testPrompt() {
    driver.assertEmpty();
    prompt = "% ";
View Full Code Here

    console.on(KeyStrokes.ENTER);
    driver.assertChar('a').assertFlush().assertCRLF().assertFlush().assertEmpty();
    driver.assertEmpty();
    ShellProcessContext context = contexts.poll();
    assertNotNull(context);
    context.end(ShellResponse.ok());
    driver.assertCRLF().assertFlush().assertChar('%').assertChar(' ').assertFlush().assertEmpty();
  }

  public void testHandleKeyInProcess() {
    final ArrayBlockingQueue<Integer> keys = new ArrayBlockingQueue<Integer>(1);
View Full Code Here

    };
    t.start();
    while (t.getState() != Thread.State.WAITING) {
      // Wait until the other thread is waiting
    }
    context.end(ShellResponse.ok());
    boolean interrupted = interrupteds.poll(3, TimeUnit.SECONDS);
    assertTrue(interrupted);
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.