use of com.thoughtworks.go.domain.BuildCommand in project gocd by gocd.
the class TestCommandExecutor method captureSubCommandOutput.
private String captureSubCommandOutput(BuildCommand command, BuildSession buildSession) {
BuildCommand targetCommand = command.getSubCommands().get(0);
ConsoleCapture consoleCapture = new ConsoleCapture();
buildSession.newTestingSession(consoleCapture).processCommand(targetCommand);
return consoleCapture.captured();
}
use of com.thoughtworks.go.domain.BuildCommand in project gocd by gocd.
the class CommandBuilder method buildCommand.
@Override
public BuildCommand buildCommand() {
String[] argsArray = CommandLine.translateCommandLine(args);
BuildCommand exec = BuildCommand.exec(command, argsArray);
if (workingDir != null) {
exec.setWorkingDirectory(workingDir.getPath());
}
return exec;
}
use of com.thoughtworks.go.domain.BuildCommand in project gocd by gocd.
the class MaterialsTest method shouldGenerateCleanupCommandForRemovingJunkFoldersWhenCleanUpIsCalled_hasOneMaterialUseBaseFolderReturnsFalse.
@Test
public void shouldGenerateCleanupCommandForRemovingJunkFoldersWhenCleanUpIsCalled_hasOneMaterialUseBaseFolderReturnsFalse() throws Exception {
Materials materials = new Materials();
GitMaterial gitMaterial = new GitMaterial("http://some-url.com", "some-branch", "some-folder");
materials.add(gitMaterial);
BuildCommand command = materials.cleanUpCommand("basedir");
assertThat(command.getName(), is("cleandir"));
assertThat(command.getStringArg("path"), is("basedir"));
assertThat(command.getArrayArg("allowed"), is(new String[] { "some-folder", "cruise-output" }));
}
Aggregations