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()AssertTool(PrintStream stdout)
-
Method Summary
All 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()Defines the interface to a Solr tool that can be run from this command-line app.List<org.apache.commons.cli.Option>getOptions()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)static intsameUser(String directory)static StringuserForDir(Path pathToDir)-
Methods inherited from class org.apache.solr.cli.ToolBase
echo, echoIfVerbose
-
-
-
-
Constructor Detail
-
AssertTool
public AssertTool()
-
AssertTool
public AssertTool(PrintStream stdout)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:ToolDefines 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
-
runImpl
public void runImpl(org.apache.commons.cli.CommandLine cli) throws Exception
-
runAssert
protected 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
-
assertSolrRunning
public static int assertSolrRunning(String url) throws Exception
- Throws:
Exception
-
assertSolrNotRunning
public static int assertSolrNotRunning(String url) throws Exception
- Throws:
Exception
-
assertSolrRunningInCloudMode
public static int assertSolrRunningInCloudMode(String url) throws Exception
- Throws:
Exception
-
assertSolrNotRunningInCloudMode
public static 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()
-
-