public class ExecutionHelper
extends java.lang.Object
| Constructor and Description |
|---|
ExecutionHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.io.InputStream |
getCommandResult(org.apache.commons.exec.CommandLine cmdLine,
java.io.File dir,
int expectedExit,
long timeout)
Run the given commandline in the given directory and verify that the tool
has the expected exit code and does finish in the timeout.
|
static java.io.InputStream |
getCommandResult(org.apache.commons.exec.CommandLine cmdLine,
java.io.File dir,
int expectedExit,
long timeout,
java.io.InputStream input)
Run the given commandline in the given directory and provide the given input to the command.
|
static void |
getCommandResultIntoStream(org.apache.commons.exec.CommandLine cmdLine,
java.io.File dir,
int expectedExit,
long timeout,
java.io.OutputStream stream)
Run the given commandline in the given directory and verify that the tool
has the expected exit code and does finish in the timeout.
|
static void |
getCommandResultIntoStream(org.apache.commons.exec.CommandLine cmdLine,
java.io.File dir,
int expectedExit,
long timeout,
java.io.OutputStream stream,
java.util.Map<java.lang.String,java.lang.String> environment)
Run the given commandline in the given directory and verify that the tool
has the expected exit code and does finish in the timeout.
|
public static java.io.InputStream getCommandResult(org.apache.commons.exec.CommandLine cmdLine,
java.io.File dir,
int expectedExit,
long timeout)
throws java.io.IOException
cmdLine - The commandline object filled with the executable and command line argumentsdir - The working directory for the commandexpectedExit - The expected exit value or -1 to not fail on any exit valuetimeout - The timeout in milliseconds or ExecuteWatchdog.INFINITE_TIMEOUTjava.io.IOException - Execution of sub-process failed or the
sub-process returned a exit value indicating a failurepublic static java.io.InputStream getCommandResult(org.apache.commons.exec.CommandLine cmdLine,
java.io.File dir,
int expectedExit,
long timeout,
java.io.InputStream input)
throws java.io.IOException
cmdLine - The commandline object filled with the executable and command line argumentsdir - The working directory for the commandexpectedExit - The expected exit value or -1 to not fail on any exit valuetimeout - The timeout in milliseconds or ExecuteWatchdog.INFINITE_TIMEOUTinput - Input for the command-executionjava.io.IOException - Execution of sub-process failed or the
sub-process returned a exit value indicating a failurepublic static void getCommandResultIntoStream(org.apache.commons.exec.CommandLine cmdLine,
java.io.File dir,
int expectedExit,
long timeout,
java.io.OutputStream stream)
throws java.io.IOException
cmdLine - The commandline object filled with the executable and command line argumentsdir - The working directory for the commandexpectedExit - The expected exit value or -1 to not fail on any exit valuetimeout - The timeout in milliseconds or ExecuteWatchdog.INFINITE_TIMEOUTstream - An OutputStream which receives the output of the executed commandjava.io.IOException - Execution of sub-process failed or the
sub-process returned a exit value indicating a failurepublic static void getCommandResultIntoStream(org.apache.commons.exec.CommandLine cmdLine,
java.io.File dir,
int expectedExit,
long timeout,
java.io.OutputStream stream,
java.util.Map<java.lang.String,java.lang.String> environment)
throws java.io.IOException
cmdLine - The commandline object filled with the executable and command line argumentsdir - The working directory for the commandexpectedExit - The expected exit value or -1 to not fail on any exit valuetimeout - The timeout in milliseconds or ExecuteWatchdog.INFINITE_TIMEOUTstream - An OutputStream which receives the output of the executed commandenvironment - Environment variables that should be set for the execution of the commandjava.io.IOException - Execution of subprocess failed or the
subprocess returned a exit value indicating a failure