Class CommandTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase
org.elasticsearch.test.ESTestCase
org.elasticsearch.cli.CommandTestCase

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 org.elasticsearch.cli.Command newCommand()
      Creates a Command to test execution.
    • execute

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

      public java.lang.String execute​(org.elasticsearch.cli.Command command, java.lang.String... args) throws java.lang.Exception
      Runs the specified command with the given args.

      Output can be found in terminal.

      Throws:
      java.lang.Exception