Class CommandTestCase

java.lang.Object
org.junit.Assert

public abstract class CommandTestCase extends ESTestCase
A base test case for cli tools.
  • Field Details

    • terminal

      protected final MockTerminal terminal
      The terminal that execute uses.
  • Constructor Details

    • CommandTestCase

      public CommandTestCase()
  • Method Details

    • resetTerminal

      public void resetTerminal()
    • newCommand

      protected abstract Command newCommand()
      Creates a Command to test execution.
    • execute

      public String execute(String... args) throws Exception
      Runs a command with the given args. Output can be found in terminal.
      Throws:
      Exception
    • execute

      public String execute(Command command, String... args) throws Exception
      Runs the specified command with the given args.

      Output can be found in terminal.

      Throws:
      Exception