Package org.crsh.shell

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


    final ArrayBlockingQueue<String> lines = new ArrayBlockingQueue<String>(1);
    Thread t = new Thread() {
      @Override
      public void run() {
        try {
          String s = context.readLine("m", true);
          lines.add(s);
        }
        catch (Exception e) {
          e.printStackTrace();
        }
View Full Code Here


    final ShellProcessContext context = contexts.poll();
    assertNotNull(context);
    console.on(KeyStrokes.b);
    console.on(KeyStrokes.ENTER);
    driver.assertEmpty();
    String line = context.readLine("m", true);
    driver.assertChar('m').assertFlush().assertChar('b').assertFlush().assertCRLF().assertFlush().assertEmpty();
    assertEquals("b", line);
  }

  /**
 
View Full Code Here

    final ArrayBlockingQueue<Boolean> interrupteds = new ArrayBlockingQueue<Boolean>(1);
    Thread t = new Thread() {
      @Override
      public void run() {
        try {
          context.readLine("", true);
        }
        catch (InterruptedException e) {
          interrupteds.add(true);
        }
        catch (Exception e) {
View Full Code Here

    t.start();
    while (t.getState() != Thread.State.WAITING) {
      // Wait until the other thread is waiting
    }
    try {
      context.readLine("", true);
      fail();
    }
    catch (IllegalStateException expected) {
    }
    t.interrupt();
View Full Code Here

    final ArrayBlockingQueue<Boolean> interrupteds = new ArrayBlockingQueue<Boolean>(1);
    Thread t = new Thread() {
      @Override
      public void run() {
        try {
          context.readLine("", true);
        }
        catch (InterruptedException e) {
          interrupteds.add(true);
        }
        catch (Exception e) {
View Full Code Here

    final ArrayBlockingQueue<Boolean> interrupteds = new ArrayBlockingQueue<Boolean>(1);
    Thread t = new Thread() {
      @Override
      public void run() {
        try {
          context.readLine("", true);
        }
        catch (InterruptedException e) {
          interrupteds.add(true);
        }
        catch (Exception e) {
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.