use of com.thoughtworks.go.domain.builder.CommandBuilder in project gocd by gocd.
the class NantTaskBuilderTest method shouldUseDefaultWorkingDirectoryByDefault.
@Test
public void shouldUseDefaultWorkingDirectoryByDefault() throws Exception {
NantTask nantTask = new NantTask();
CommandBuilder commandBuilder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, TasksTest.pipelineStub("label", "/cruise"), resolver);
assertThat(commandBuilder.getWorkingDir(), is(new File("/cruise")));
}
use of com.thoughtworks.go.domain.builder.CommandBuilder in project gocd by gocd.
the class NantTaskBuilderTest method shouldDealWithSpacesInNantPath.
@Test
public void shouldDealWithSpacesInNantPath() throws Exception {
NantTask nantTask = new NantTask();
nantTask.setNantPath("lib/nant 1.0");
nantTask.setBuildFile("ccnet default.build");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, pipeline, resolver);
assertThat(new File(builder.getCommand()), is(new File("lib/nant 1.0/nant")));
assertThat(builder.getArgs(), is("-buildfile:\"ccnet default.build\""));
}
use of com.thoughtworks.go.domain.builder.CommandBuilder in project gocd by gocd.
the class NantTaskBuilderTest method nantTaskShouldNormalizeWorkingDirectory.
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { DO_NOT_RUN_ON, WINDOWS })
public void nantTaskShouldNormalizeWorkingDirectory() throws Exception {
NantTask nantTask = new NantTask();
nantTask.setWorkingDirectory("folder1\\folder2");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, TasksTest.pipelineStub("label", "/var/cruise-agent/pipelines/cruise"), resolver);
assertThat(builder.getWorkingDir(), Is.is(new File("/var/cruise-agent/pipelines/cruise/folder1/folder2")));
}
use of com.thoughtworks.go.domain.builder.CommandBuilder in project gocd by gocd.
the class NantTaskBuilderTest method shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnLinux.
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { DO_NOT_RUN_ON, WINDOWS })
public void shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnLinux() throws Exception {
NantTask nantTask = new NantTask();
nantTask.setNantPath("/usr/bin");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, pipeline, resolver);
assertThat(new File(builder.getCommand()), is(new File("/usr/bin/nant")));
}
use of com.thoughtworks.go.domain.builder.CommandBuilder in project gocd by gocd.
the class NantTaskBuilderTest method nantTaskShouldNormalizeBuildFile.
@Test
public void nantTaskShouldNormalizeBuildFile() throws Exception {
NantTask task = new NantTask();
task.setBuildFile("pavan\\build.xml");
CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, task, pipeline, resolver);
assertThat(builder.getArgs(), Is.is("-buildfile:\"pavan/build.xml\""));
}
Aggregations