public class Httest
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ENV_ACTION_INHERIT |
static java.lang.String |
ENV_ACTION_MERGE |
static java.lang.String |
ENV_ACTION_REPLACE |
static java.lang.String |
HTTEST_ENV |
static java.lang.String |
HTTEST_HOME |
static java.lang.String |
HTTEST_WORKDIR |
static java.lang.String |
VERSION_PROPERTY
Constant for name of system property which holds httest version.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
getBinariesDir()
Gets the binaries directory for httest binaries.
|
Environment |
getEnvironment()
Gets the environment to use when running httest.
|
java.util.List<HttestError> |
getErrors()
Returns the errors in case there was one.
|
java.io.File |
getHtntlmFile()
Gets file for htntlm executable.
|
static java.lang.String |
getHtntlmFilename()
Gets file name of htntlm executable; "htntlm" on windows
and "htntlm" on unix.
|
java.io.File |
getHttestBinaryExecutableFile()
Gets file for httest executable.
|
static java.lang.String |
getHttestBinaryExecutableFilename()
Gets file name of httest executable; "httest.exe" on windows
and "httest" on unix.
|
static OperatingSystem |
getOs()
Return the current operating system.
|
java.io.File |
getWorkingDir()
Gets the working directory to use when running httest.
|
static Httest |
instance(java.io.File binariesDir,
java.io.File workingDir,
Environment environment)
Creates a new Httest instance.
|
static Httest |
instance(java.util.Properties props)
Convenience method for creating a new Httest instance from properties.
|
void |
interruptExecution()
Interrupts the executed process.
|
boolean |
isInterrupted()
Allows to check if this httest execution was interrupted.
|
boolean |
isVerbose()
Get info if httest output is verbose, i.e.
|
ExecResult |
runScript(java.io.File scriptFile,
java.lang.String... commandLineArgs)
Run the script with the given file.
|
ExecResult |
runScript(ITestListener console,
java.io.File scriptFile,
java.lang.String... commandLineArgs)
Run the script with the given file.
|
ExecResult |
runScript(ITestListener console,
java.lang.String scriptFileName,
java.lang.String... commandLineArgs)
Run the script with the given file name,
relative to the current working directory.
|
ExecResult |
runScript(java.lang.String scriptFileName,
java.lang.String... commandLineArgs)
Run the script with the given file name and path,
relative to the current working directory.
|
void |
setEnvironment(Environment environment)
Sets the environment to use when running httest.
|
void |
setVerbose(boolean verbose)
Set info if httest output is verbose, i.e.
|
java.lang.String |
testBinary()
Runs the httest binary with the argument "-V" and returns
the version number.
|
public static final java.lang.String VERSION_PROPERTY
public static final java.lang.String HTTEST_HOME
public static final java.lang.String HTTEST_WORKDIR
public static final java.lang.String HTTEST_ENV
public static final java.lang.String ENV_ACTION_INHERIT
public static final java.lang.String ENV_ACTION_REPLACE
public static final java.lang.String ENV_ACTION_MERGE
public static Httest instance(java.io.File binariesDir, java.io.File workingDir, Environment environment)
binariesDir - Directory that contains httest binaries.workingDir - Working directory when httest is run, relevant e.g.
for _INCLUDE, if null means that use the current working directory.environment - Environment to use, if null inherit from parent process.java.lang.RuntimeException - If the instance could not be created.public static Httest instance(java.util.Properties props)
java.lang.IllegalArgumentException - If HTTEST_HOME is not defined.java.lang.RuntimeException - If the instance could not be created.public ExecResult runScript(java.io.File scriptFile, java.lang.String... commandLineArgs) throws java.io.IOException, HttestFailedException
scriptFile - The file of the httest script to execute.commandLineArgs - Optional command line arguments for the executed binary.java.io.IOExceptionHttestFailedExceptionpublic ExecResult runScript(java.lang.String scriptFileName, java.lang.String... commandLineArgs) throws java.io.IOException, HttestFailedException
scriptFileName - The name of the httest script to execute.commandLineArgs - Optional command line arguments for the executed binary.java.io.IOExceptionHttestFailedExceptionpublic ExecResult runScript(ITestListener console, java.io.File scriptFile, java.lang.String... commandLineArgs) throws java.io.IOException, HttestFailedException
console - The console output window (for the GUI). Is null in command-line mode.scriptFile - The file of the httest script to execute.commandLineArgs - Optional command line arguments for the executed binary.java.io.IOExceptionHttestFailedExceptionpublic ExecResult runScript(ITestListener console, java.lang.String scriptFileName, java.lang.String... commandLineArgs) throws java.io.IOException, HttestFailedException
console - The console output window (for the GUI). Is null in command-line mode.scriptFileName - The name of the httest script to execute.commandLineArgs - Optional command line arguments for the executed binary.java.io.IOExceptionHttestFailedExceptionpublic java.lang.String testBinary()
throws java.io.IOException
java.io.IOExceptionjava.lang.IllegalStateExceptionpublic java.util.List<HttestError> getErrors()
public void interruptExecution()
public boolean isInterrupted()
public java.io.File getHttestBinaryExecutableFile()
public static java.lang.String getHttestBinaryExecutableFilename()
public java.io.File getHtntlmFile()
public static java.lang.String getHtntlmFilename()
public java.io.File getBinariesDir()
public java.io.File getWorkingDir()
public Environment getEnvironment()
public void setEnvironment(Environment environment)
environment - the environment to setpublic boolean isVerbose()
public void setVerbose(boolean verbose)
verbose - the verbose to setpublic static OperatingSystem getOs()