Examples of Exec


Examples of com.bj58.spat.gaea.server.performance.commandhelper.Exec

public class ExecTest {

  @Test
  public void testCreateCommand() {
    Exec exec = new Exec();
    Command command1 = exec.createCommand("exec|netstat -na");
    assertEquals(CommandType.Exec, command1.getCommandType());
    assertEquals("netstat -na", command1.getCommand());
   
    Command command2 = exec.createCommand("exec|killall java");
    assertEquals(CommandType.Illegal, command2.getCommandType());
  }
View Full Code Here

Examples of net.ex337.scriptus.model.api.functions.Exec

    throw pending;
  }

  public Object exec(String program, String args) {
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Exec(program, args));
    throw pending;
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.find.Exec

    TestCommand.testConf = conf;
  }
 
  @Test
  public void addArguments() throws IOException {
    Exec exec = new Exec();
    exec.addArguments(getArgs("one two three ; four"));
    assertEquals("Exec(one,two,three;)", exec.toString());
    assertFalse(exec.isBatch());
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.find.Exec

    assertFalse(exec.isBatch());
  }

  @Test
  public void addArgumentsBracket() throws IOException {
    Exec exec = new Exec();
    exec.addArguments(getArgs("one {} three ; four"));
    assertEquals("Exec(one,{},three;)", exec.toString());
    assertFalse(exec.isBatch());
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.find.Exec

    assertFalse(exec.isBatch());
  }

  @Test
  public void addArgumentsPlus() throws IOException {
    Exec exec = new Exec();
    exec.addArguments(getArgs("one two three + four"));
    assertEquals("Exec(one,two,three,+,four;)", exec.toString());
    assertFalse(exec.isBatch());
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.find.Exec

    assertFalse(exec.isBatch());
  }

  @Test
  public void addArgumentsBracketPlus() throws IOException {
    Exec exec = new Exec();
    exec.addArguments(getArgs("one two {} + four"));
    assertEquals("Exec(one,two,{};)", exec.toString());
    assertTrue(exec.isBatch());
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.find.Exec

  }

  @Test
  public void testFsShellCommand() throws IOException {
    factory.registerCommands(FsCommand.class);
    Exec exec = new Exec();
    exec.addArguments(getArgs("-ls {} ;"));
    exec.initialise(options);
    Command cmd = exec.getCommand();
    assertEquals("org.apache.hadoop.fs.shell.Ls", cmd.getClass().getName());
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.find.Exec

  }
 
  @Test
  public void testUnknownCommand() throws IOException {
    TestCommand.testErr = System.err;
    Exec exec = new Exec();
    exec.addArguments(getArgs("-invalid arg1 arg2 ;"));
    try {
      exec.initialise(options);
      fail("Invalid command not caught");
    }
    catch(IOException e) {
      assertEquals("Unknown command: -invalid", e.getMessage());
    }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.find.Exec

    verifyNoMoreInteractions(err);
  }

  @Test
  public void testTestCommand() throws IOException {
    Exec exec = new Exec();
    exec.addArguments(getArgs("-testCommand ;"));
    exec.initialise(options);
    Command cmd = exec.getCommand();
    assertEquals(TestCommand.class, cmd.getClass());
    verifyNoMoreInteractions(out);
    verifyNoMoreInteractions(err);
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.find.Exec

    verifyNoMoreInteractions(err);
  }
 
  @Test
  public void applyOneArg() throws IOException {
    Exec exec = new Exec();
    exec.addArguments(getArgs("-testCommand {} ;"));
    exec.initialise(options);
    assertEquals(Result.PASS, exec.apply(item));
    verify(out).println("TestCommand.processPath:"+item.toString());
    verifyNoMoreInteractions(out);
    verifyNoMoreInteractions(err);
  }
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.