Package test.shell.base

Examples of test.shell.base.BaseProcess


    final LinkedList<String> requests = new LinkedList<String>();
    final CountDownLatch latch = new CountDownLatch(1);
    Controller controller = create(new BaseShell(BaseProcessFactory.ECHO) {
      @Override
      public ShellProcess createProcess(String request) {
        return new BaseProcess(request) {
          @Override
          protected ShellResponse execute(String request) {
            requests.add(request);
            latch.countDown();
            return super.execute(request);
View Full Code Here


  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 {
            if ("bye".equals(request)) {
              processContext.end(ShellResponse.close());
            } else {
View Full Code Here

  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 {
            if ("bye".equals(request)) {
              processContext.end(ShellResponse.close());
            } else {
View Full Code Here

  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 {
            processContext.append("juu");
            processContext.end(ShellResponse.ok());
          }
View Full Code Here

  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) {
            return ShellResponse.close();
          }
        };
View Full Code Here

  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) {
            return ShellResponse.close();
          }
        };
View Full Code Here

    ClientProcessor t = new ClientProcessor(clientOIS, clientOOS, new BaseShell(new BaseProcessFactory() {
      int count = 0;
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          public void process(String request, final ShellProcessContext processContext) throws IOException {
            if (count == 0) {
              count = 1;
              new Thread() {
View Full Code Here

    //
    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 {
            new Thread() {
              @Override
              public void run() {
View Full Code Here

    //
    BaseProcessFactory factory = new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          public void process(String request, ShellProcessContext processContext) throws IOException {
            String a = null;
            try {
              a = readLine("bar", true);
View Full Code Here

    //
    BaseProcessFactory factory = new BaseProcessFactory() {
      @Override
      public BaseProcess create(String request) {
        return new BaseProcess(request) {
          @Override
          protected ShellResponse execute(String request) {
            latch1.countDown();
            try {
              latch2.await();
View Full Code Here

TOP

Related Classes of test.shell.base.BaseProcess

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.