use of com.thoughtworks.go.domain.config.Arguments in project gocd by gocd.
the class ExecTaskTest method shouldSupportMultipleArgs.
@Test
public void shouldSupportMultipleArgs() throws Exception {
String xml = "<exec command='ls'>\n" + " <arg>arg1</arg>\n" + " <arg>arg2</arg>\n" + "</exec>";
ExecTask execTask = new MagicalGoConfigXmlLoader(new ConfigCache(), ConfigElementImplementationRegistryMother.withNoPlugins()).fromXmlPartial(xml, ExecTask.class);
assertThat(execTask.getArgList(), is(new Arguments(new Argument("arg1"), new Argument("arg2"))));
}
use of com.thoughtworks.go.domain.config.Arguments in project gocd by gocd.
the class ExecTaskTest method shouldUnEqualIfCommandsDontMatch.
@Test
public void shouldUnEqualIfCommandsDontMatch() {
ExecTask task = new ExecTask("ls", new Arguments());
assertFalse(task.equals(new ExecTask("rm", new Arguments())));
}
use of com.thoughtworks.go.domain.config.Arguments in project gocd by gocd.
the class ExecTaskTest method describeMutipleArgumentsTest.
@Test
public void describeMutipleArgumentsTest() {
ExecTask task = new ExecTask("echo", null, new Arguments(new Argument("abc"), new Argument("hello baby!")));
task.setTimeout(600);
assertThat(task.describe(), Is.is("echo abc \"hello baby!\""));
}
use of com.thoughtworks.go.domain.config.Arguments in project gocd by gocd.
the class ExecTaskTest method shouldUnEqualIfCommandIsNull.
@Test
public void shouldUnEqualIfCommandIsNull() {
ExecTask task = new ExecTask(null, new Arguments());
assertFalse(task.equals(new ExecTask("rm", new Arguments())));
}
use of com.thoughtworks.go.domain.config.Arguments in project gocd by gocd.
the class ExecTaskTest method shouldReturnCommandArgumentList.
@Test
public void shouldReturnCommandArgumentList() {
ExecTask task = new ExecTask("./bn", new Arguments(new Argument("clean"), new Argument("compile"), new Argument("\"buildfile\"")), "src/build");
assertThat(task.arguments(), is("clean compile \"buildfile\""));
}
Aggregations