Package com.atlassian.bamboo.testutils
Class CommandExecutor
- java.lang.Object
-
- com.atlassian.bamboo.testutils.CommandExecutor
-
public class CommandExecutor extends Object
-
-
Constructor Summary
Constructors Constructor Description CommandExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessDescriptor
exec(String command)
A naive exec method that splits the passed command at each space.ProcessDescriptor
exec(String[] command)
ProcessDescriptor
exec(String[] command, @Nullable File workingDirectory, Duration timeout)
ProcessDescriptor
startDaemon(String[] command, Duration timeout)
void
stopDaemon(ProcessDescriptor processDescriptor)
-
-
-
Method Detail
-
startDaemon
public ProcessDescriptor startDaemon(String[] command, Duration timeout) throws IOException
- Throws:
IOException
-
stopDaemon
public void stopDaemon(ProcessDescriptor processDescriptor) throws InterruptedException
- Throws:
InterruptedException
-
exec
public ProcessDescriptor exec(String[] command, @Nullable @Nullable File workingDirectory, Duration timeout) throws IOException, TimeoutException, InterruptedException
-
exec
public ProcessDescriptor exec(String[] command) throws TimeoutException, IOException, InterruptedException
-
exec
public ProcessDescriptor exec(String command) throws TimeoutException, IOException, InterruptedException
A naive exec method that splits the passed command at each space. Thus will break if any single value is a space- Parameters:
command
-- Throws:
TimeoutException
IOException
InterruptedException
-
-