Class CommandTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase
org.opensearch.test.OpenSearchTestCase
org.opensearch.cli.CommandTestCase

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

  • Constructor Details

  • Method Details

    • resetTerminal

      public void resetTerminal()
    • newCommand

      protected abstract org.opensearch.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.opensearch.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