Search in sources :

Example 6 with BuildCommand

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();
}
Also used : BuildCommand(com.thoughtworks.go.domain.BuildCommand)

Example 7 with BuildCommand

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;
}
Also used : BuildCommand(com.thoughtworks.go.domain.BuildCommand)

Example 8 with BuildCommand

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" }));
}
Also used : GitMaterial(com.thoughtworks.go.config.materials.git.GitMaterial) BuildCommand(com.thoughtworks.go.domain.BuildCommand) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Test(org.junit.Test)

Aggregations

BuildCommand (com.thoughtworks.go.domain.BuildCommand)8 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)2 RunIf (com.googlecode.junit.ext.RunIf)1 JavaSysMon (com.jezhumble.javasysmon.JavaSysMon)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)1 EnvironmentVariableContext (com.thoughtworks.go.util.command.EnvironmentVariableContext)1