Search in sources :

Example 11 with NantTask

use of com.thoughtworks.go.config.NantTask in project gocd by gocd.

the class NantTaskBuilderTest method shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnWindows.

@Test
@EnabledOnOs(OS.WINDOWS)
void shouldUseAbsoluteNantPathIfAbsoluteNantPathIsSpecifiedOnWindows() {
    NantTask nantTask = new NantTask();
    nantTask.setNantPath("c:\\nantdir");
    CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, pipeline, resolver);
    assertThat(new File(builder.getCommand())).isEqualTo(new File("c:\\nantdir\\nant"));
}
Also used : NantTask(com.thoughtworks.go.config.NantTask) CommandBuilder(com.thoughtworks.go.domain.builder.CommandBuilder) File(java.io.File) EnabledOnOs(org.junit.jupiter.api.condition.EnabledOnOs) Test(org.junit.jupiter.api.Test)

Example 12 with NantTask

use of com.thoughtworks.go.config.NantTask in project gocd by gocd.

the class NantTaskBuilderTest method shouldSetNAntWorkingDirectoryAbsolutelyIfSpecified.

@Test
void shouldSetNAntWorkingDirectoryAbsolutelyIfSpecified() {
    final File absoluteFile = new File("project").getAbsoluteFile();
    NantTask task = new NantTask();
    task.setWorkingDirectory(absoluteFile.getPath());
    CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, task, pipeline, resolver);
    assertThat(builder.getWorkingDir()).isEqualTo(absoluteFile);
}
Also used : NantTask(com.thoughtworks.go.config.NantTask) CommandBuilder(com.thoughtworks.go.domain.builder.CommandBuilder) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 13 with NantTask

use of com.thoughtworks.go.config.NantTask in project gocd by gocd.

the class NantTaskBuilderTest method shouldJoinNantPathWithWorkingDirectoryIfRelativeNantPathIsSpecified.

@Test
void shouldJoinNantPathWithWorkingDirectoryIfRelativeNantPathIsSpecified() {
    NantTask nantTask = new NantTask();
    nantTask.setNantPath("lib");
    CommandBuilder builder = (CommandBuilder) nantTaskBuilder.createBuilder(builderFactory, nantTask, pipeline, resolver);
    assertThat(new File(builder.getCommand())).isEqualTo(new File("lib/nant"));
}
Also used : NantTask(com.thoughtworks.go.config.NantTask) CommandBuilder(com.thoughtworks.go.domain.builder.CommandBuilder) File(java.io.File) Test(org.junit.jupiter.api.Test)

Aggregations

NantTask (com.thoughtworks.go.config.NantTask)13 CommandBuilder (com.thoughtworks.go.domain.builder.CommandBuilder)9 Test (org.junit.jupiter.api.Test)9 File (java.io.File)7 DisabledOnOs (org.junit.jupiter.api.condition.DisabledOnOs)2 AntTask (com.thoughtworks.go.config.AntTask)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 ExecTask (com.thoughtworks.go.config.ExecTask)1 RakeTask (com.thoughtworks.go.config.RakeTask)1 Tasks (com.thoughtworks.go.config.Tasks)1 StringUtils.defaultString (org.apache.commons.lang.StringUtils.defaultString)1 EnabledOnOs (org.junit.jupiter.api.condition.EnabledOnOs)1