Package org.apache.solr.cli
Class AssertTool
- java.lang.Object
-
- org.apache.solr.cli.ToolBase
-
- org.apache.solr.cli.AssertTool
-
-
Constructor Summary
Constructors Constructor Description AssertTool(ToolRuntime runtime)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
assertFileExists(String directory)
static int
assertFileNotExists(String directory)
static int
assertNotRootUser()
static int
assertRootUser()
int
assertSolrNotRunning(String url)
int
assertSolrNotRunningInCloudMode(String url)
int
assertSolrRunning(String url)
int
assertSolrRunningInCloudMode(String url)
static String
currentUser()
String
getName()
Defines the interface to a Solr tool that can be run from this command-line app.List<org.apache.commons.cli.Option>
getOptions()
protected int
runAssert(org.apache.commons.cli.CommandLine cli)
Custom run method which may return exit codevoid
runImpl(org.apache.commons.cli.CommandLine cli)
int
runTool(org.apache.commons.cli.CommandLine cli)
Returns 100 error code for a true "error", otherwise returns the number of tests that failed.static int
sameUser(String directory)
static String
userForDir(Path pathToDir)
-
Methods inherited from class org.apache.solr.cli.ToolBase
echo, echoIfVerbose, getRuntime, isVerbose
-
-
-
-
Constructor Detail
-
AssertTool
public AssertTool(ToolRuntime runtime)
-
-
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()
-
runTool
public int runTool(org.apache.commons.cli.CommandLine cli) throws Exception
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
public void runImpl(org.apache.commons.cli.CommandLine cli) throws Exception
-
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
-
assertSolrNotRunning
public int assertSolrNotRunning(String url) throws Exception
- Throws:
Exception
-
assertSolrRunningInCloudMode
public int assertSolrRunningInCloudMode(String url) throws Exception
- Throws:
Exception
-
assertSolrNotRunningInCloudMode
public int assertSolrNotRunningInCloudMode(String url) throws Exception
- Throws:
Exception
-
assertFileExists
public static int assertFileExists(String directory) throws Exception
- Throws:
Exception
-
assertFileNotExists
public static int assertFileNotExists(String directory) throws Exception
- Throws:
Exception
-
currentUser
public static String currentUser()
-
-