Class AssertTool

  • All Implemented Interfaces:
    Tool

    public class AssertTool
    extends ToolBase
    Asserts various conditions and exists with error code if fails, else continues with no output
    • Constructor Detail

      • AssertTool

        public AssertTool()
      • AssertTool

        public AssertTool​(PrintStream stdout)
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Tool
        Defines the interface to a Solr tool that can be run from this command-line app.
      • getOptions

        public List<org.apache.commons.cli.Option> getOptions()
      • runAssert

        protected int runAssert​(org.apache.commons.cli.CommandLine cli)
                         throws Exception
        Custom run method which may return exit code
        Parameters:
        cli - the command line object
        Returns:
        0 on success, or a number corresponding to number of tests that failed
        Throws:
        Exception - if a tool failed, e.g. authentication failure
      • assertSolrRunningInCloudMode

        public static int assertSolrRunningInCloudMode​(String url)
                                                throws Exception
        Throws:
        Exception
      • assertSolrNotRunningInCloudMode

        public static int assertSolrNotRunningInCloudMode​(String url)
                                                   throws Exception
        Throws:
        Exception
      • assertNotRootUser

        public static int assertNotRootUser()
                                     throws Exception
        Throws:
        Exception
      • currentUser

        public static String currentUser()
      • userForDir

        public static String userForDir​(Path pathToDir)