Package org.apache.any23.cli

## Class ToolTestBase

- java.lang.Object
- - org.apache.any23.AbstractAny23TestBase
  - - org.apache.any23.Any23OnlineTestBase
    - - org.apache.any23.cli.ToolTestBase

- Direct Known Subclasses:
    `ExtractorDocumentationTest`, `ExtractorsFlowTest`, `MicrodataParserTest`, `MimeDetectorTest`, `PluginVerifierTest`, `RoverTest`, `SimpleRoverTest`, `VocabPrinterTest`, `YAMLRoverTest`

      public abstract class ToolTestBase
      extends Any23OnlineTestBase

  Base class for CLI related tests.
  Author:
    Michele Mostarda (mostarda@fbk.eu)

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `TOOL_RUN_METHOD` |

    - ### Fields inherited from class org.apache.any23.Any23OnlineTestBase

      `ONLINE_TEST_DISABLED_FLAG`

    - ### Fields inherited from class org.apache.any23.AbstractAny23TestBase

      `tempDirectory, testFolder`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `ToolTestBase​(Class<? extends Tool> tool)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected int` | `runTool​(String args)` | Runs the underlying tool.
    `protected int` | `runTool​(String... args)` | Runs the underlying tool.
    `protected void` | `runToolCheckExit0​(String... args)` | Runs the underlying tool and verify the exit code to `0`.

    - ### Methods inherited from class org.apache.any23.Any23OnlineTestBase

      `assumeOnlineAllowed`

    - ### Methods inherited from class org.apache.any23.AbstractAny23TestBase

      `copyResourceToTempFile, getDocumentSourceFromResource, getDocumentSourceFromResource, setUp`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TOOL_RUN_METHOD

          public static final String TOOL_RUN_METHOD

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ToolTestBase

          protected ToolTestBase​(Class<? extends Tool> tool)

  - ### Method Detail

    - #### runTool

          protected int runTool​(String... args)
                         throws Exception

      Runs the underlying tool.
      Parameters:
        `args` - tool arguments.
      Returns:
        the tool exit code.
      Throws:
        `Exception` - if there is an error asserting the test data.

    - #### runTool

          protected int runTool​(String args)
                         throws Exception

      Runs the underlying tool.
      Parameters:
        `args` - args tool arguments.
      Returns:
        the tool exit code.
      Throws:
        `Exception` - if there is an error asserting the test data.

    - #### runToolCheckExit0

          protected void runToolCheckExit0​(String... args)
                                    throws Exception

      Runs the underlying tool and verify the exit code to `0`.
      Parameters:
        `args` - tool arguments.
      Throws:
        `Exception` - if there is an error asserting the test data.