Package org.apache.solr.util
Class SolrCLI.AssertTool
- java.lang.Object
- 
- org.apache.solr.util.SolrCLI.ToolBase
- 
- org.apache.solr.util.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
- 
- 
Field Summary- 
Fields inherited from class org.apache.solr.util.SolrCLI.ToolBasestdout, verbose
 
- 
 - 
Constructor SummaryConstructors Constructor Description AssertTool()AssertTool(PrintStream stdout)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intassertFileExists(String directory)static intassertFileNotExists(String directory)static intassertNotRootUser()static intassertRootUser()static intassertSolrNotRunning(String url)static intassertSolrNotRunningInCloudMode(String url)static intassertSolrRunning(String url)static intassertSolrRunningInCloudMode(String url)static StringcurrentUser()StringgetName()org.apache.commons.cli.Option[]getOptions()protected intrunAssert(org.apache.commons.cli.CommandLine cli)Custom run method which may return exit codeprotected voidrunImpl(org.apache.commons.cli.CommandLine cli)intrunTool(org.apache.commons.cli.CommandLine cli)static intsameUser(String directory)static StringuserForDir(Path pathToDir)- 
Methods inherited from class org.apache.solr.util.SolrCLI.ToolBaseecho, echoIfVerbose
 
- 
 
- 
- 
- 
Constructor Detail- 
AssertToolpublic AssertTool() 
 - 
AssertToolpublic AssertTool(PrintStream stdout) 
 
- 
 - 
Method Detail- 
getNamepublic String getName() 
 - 
getOptionspublic org.apache.commons.cli.Option[] getOptions() 
 - 
runToolpublic int runTool(org.apache.commons.cli.CommandLine cli) throws Exception- Specified by:
- runToolin interface- SolrCLI.Tool
- Overrides:
- runToolin class- SolrCLI.ToolBase
- Throws:
- Exception
 
 - 
runImplprotected void runImpl(org.apache.commons.cli.CommandLine cli) throws Exception- Specified by:
- runImplin class- SolrCLI.ToolBase
- Throws:
- Exception
 
 - 
runAssertprotected int runAssert(org.apache.commons.cli.CommandLine cli) throws ExceptionCustom 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
 
 - 
assertSolrRunningpublic static int assertSolrRunning(String url) throws Exception - Throws:
- Exception
 
 - 
assertSolrNotRunningpublic static int assertSolrNotRunning(String url) throws Exception - Throws:
- Exception
 
 - 
assertSolrRunningInCloudModepublic static int assertSolrRunningInCloudMode(String url) throws Exception - Throws:
- Exception
 
 - 
assertSolrNotRunningInCloudModepublic static int assertSolrNotRunningInCloudMode(String url) throws Exception - Throws:
- Exception
 
 - 
assertFileExistspublic static int assertFileExists(String directory) throws Exception - Throws:
- Exception
 
 - 
assertFileNotExistspublic static int assertFileNotExists(String directory) throws Exception - Throws:
- Exception
 
 - 
currentUserpublic static String currentUser() 
 
- 
 
-