Interface CommandLauncher
-
- All Known Implementing Classes:
MockCommandLauncher,RealCommandLauncher
public interface CommandLauncherAllows starting a process, waiting for it to finish, and retrieving its exit code and output. Its API is similar toLauncher. We use this interface instead of hudson.Launcher directly so that we can mock its behavior in tests.There are two implementations:
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CommandLaunchercmds(String... args)CommandLauncherenvs(Map<String,String> overrides)intgetCode()StringgetOutput()CommandLaunchermasks(boolean... values)CommandLauncherpwd(String path)CommandLauncherquiet(boolean value)voidstartAndJoin()
-
-
-
Method Detail
-
cmds
CommandLauncher cmds(@Nonnull String... args)
-
envs
CommandLauncher envs(@Nonnull Map<String,String> overrides)
-
masks
CommandLauncher masks(@Nonnull boolean... values)
-
quiet
CommandLauncher quiet(boolean value)
-
pwd
CommandLauncher pwd(@Nonnull String path)
-
startAndJoin
void startAndJoin() throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
getCode
int getCode()
-
getOutput
String getOutput()
-
-