Package org.apache.solr.cli
Class AssertTool
java.lang.Object
org.apache.solr.cli.ToolBase
org.apache.solr.cli.AssertTool
- All Implemented Interfaces:
Tool
Asserts various conditions and exists with error code if fails, else continues with no output
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intassertFileExists(String directory) static intassertFileNotExists(String directory) static intstatic intintintintassertSolrRunning(String url) intstatic StringgetName()Defines the interface to a Solr tool that can be run from this command-line app.List<org.apache.commons.cli.Option> protected intrunAssert(org.apache.commons.cli.CommandLine cli) Custom run method which may return exit codevoidrunImpl(org.apache.commons.cli.CommandLine cli) intrunTool(org.apache.commons.cli.CommandLine cli) Returns 100 error code for a true "error", otherwise returns the number of tests that failed.static intstatic StringuserForDir(Path pathToDir) Methods inherited from class org.apache.solr.cli.ToolBase
echo, echoIfVerbose, getRuntime, isVerbose
-
Constructor Details
-
AssertTool
-
-
Method Details
-
getName
Description copied from interface:ToolDefines the interface to a Solr tool that can be run from this command-line app. -
getOptions
-
runTool
Returns 100 error code for a true "error", otherwise returns the number of tests that failed. Otherwise, very similar to the parent runTool method. -
runImpl
-
runAssert
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
-
assertSolrRunning
- Throws:
Exception
-
assertSolrNotRunning
- Throws:
Exception
-
assertSolrRunningInCloudMode
- Throws:
Exception
-
assertSolrNotRunningInCloudMode
- Throws:
Exception
-
sameUser
- Throws:
Exception
-
assertFileExists
- Throws:
Exception
-
assertFileNotExists
- Throws:
Exception
-
assertRootUser
- Throws:
Exception
-
assertNotRootUser
- Throws:
Exception
-
currentUser
-
userForDir
-