Search in sources :

Example 21 with ExecTask

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

the class ExecTaskBuilderTest method shouldUseProjectDefaultWorkingDirectoryIfNotSpecified.

@Test
void shouldUseProjectDefaultWorkingDirectoryIfNotSpecified() {
    ExecTask task = new ExecTask("command", "", (String) null);
    final File defaultWorkingDir = new File("foo");
    CommandBuilder builder = (CommandBuilder) execTaskBuilder.createBuilder(builderFactory, task, pipelineStub("label", "foo"), resolver);
    assertThat(builder.getWorkingDir()).isEqualTo(defaultWorkingDir);
}
Also used : ExecTask(com.thoughtworks.go.config.ExecTask) CommandBuilder(com.thoughtworks.go.domain.builder.CommandBuilder) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 22 with ExecTask

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

the class ExecTaskTest method validateTask_shouldValidateThatCommandIsRequired.

@Test
public void validateTask_shouldValidateThatCommandIsRequired() {
    ExecTask execTask = new ExecTask();
    execTask.validateTask(null);
    assertThat(execTask.errors().isEmpty(), is(false));
    assertThat(execTask.errors().on(ExecTask.COMMAND), is("Command cannot be empty"));
}
Also used : ExecTask(com.thoughtworks.go.config.ExecTask) Test(org.junit.jupiter.api.Test)

Aggregations

ExecTask (com.thoughtworks.go.config.ExecTask)22 Test (org.junit.Test)10 AntTask (com.thoughtworks.go.config.AntTask)9 PluggableViewModel (com.thoughtworks.go.plugins.presentation.PluggableViewModel)8 FetchTask (com.thoughtworks.go.config.FetchTask)7 Test (org.junit.jupiter.api.Test)7 PluggableTask (com.thoughtworks.go.config.pluggabletask.PluggableTask)5 Task (com.thoughtworks.go.domain.Task)5 FetchPluggableArtifactTask (com.thoughtworks.go.config.FetchPluggableArtifactTask)4 TaskViewModel (com.thoughtworks.go.presentation.TaskViewModel)4 ArrayList (java.util.ArrayList)4 Builder (com.thoughtworks.go.domain.builder.Builder)3 CommandBuilder (com.thoughtworks.go.domain.builder.CommandBuilder)3 Tasks (com.thoughtworks.go.config.Tasks)2 File (java.io.File)2 Argument (com.thoughtworks.go.config.Argument)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 ConfigCache (com.thoughtworks.go.config.ConfigCache)1 MagicalGoConfigXmlLoader (com.thoughtworks.go.config.MagicalGoConfigXmlLoader)1 NantTask (com.thoughtworks.go.config.NantTask)1