Interface CommandLauncher
-
- All Known Implementing Classes:
MockCommandLauncher
,RealCommandLauncher
public interface CommandLauncher
Allows 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 CommandLauncher
cmds(String... args)
CommandLauncher
envs(Map<String,String> overrides)
int
getCode()
String
getOutput()
CommandLauncher
masks(boolean... values)
CommandLauncher
pwd(String path)
CommandLauncher
quiet(boolean value)
void
startAndJoin()
-
-
-
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:
IOException
InterruptedException
-
getCode
int getCode()
-
getOutput
String getOutput()
-
-