Class SolrCLI.AssertTool

  • All Implemented Interfaces:
    SolrCLI.Tool
    Enclosing class:
    SolrCLI

    public static class SolrCLI.AssertTool
    extends SolrCLI.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()
      • getOptions

        public 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)