use of com.thoughtworks.go.domain.StubGoPublisher in project gocd by gocd.
the class BuildersTest method shouldNotCancelAnythingIfAllBuildersHaveRun.
@Test
public void shouldNotCancelAnythingIfAllBuildersHaveRun() throws Exception {
EnvironmentVariableContext environmentVariableContext = new EnvironmentVariableContext();
Builder builder = new StubBuilder(new RunIfConfigs(ANY));
Builders builders = new Builders(Collections.singletonList(builder), new StubGoPublisher(), null, null, null);
builders.build(environmentVariableContext, "utf-8");
builders.cancel(environmentVariableContext, "utf-8");
}
use of com.thoughtworks.go.domain.StubGoPublisher in project gocd by gocd.
the class BuildersTest method shouldNotBuildIfTheJobIsCanceled.
@Test
public void shouldNotBuildIfTheJobIsCanceled() throws Exception {
StubGoPublisher goPublisher = new StubGoPublisher();
EnvironmentVariableContext environmentVariableContext = new EnvironmentVariableContext();
CommandBuilder builder = new CommandBuilder("echo", "hello", new File("."), new RunIfConfigs(FAILED), new com.thoughtworks.go.domain.builder.StubBuilder(), "");
Builders builders = new Builders(Collections.singletonList(builder), goPublisher, null, null, null);
builders.setIsCancelled(true);
builders.build(environmentVariableContext, "utf-8");
assertThat(goPublisher.getMessage(), is(""));
}
use of com.thoughtworks.go.domain.StubGoPublisher in project gocd by gocd.
the class AntTaskBuilderTest method shouldFailWhenTargetDoesNotExist.
@Test
void shouldFailWhenTargetDoesNotExist() {
String target = "not-exist-target";
String buildXml = "./build.xml";
antTask.setBuildFile(buildXml);
antTask.setTarget(target);
Builder builder = antTaskBuilder.createBuilder(builderFactory, antTask, ExecTaskBuilderTest.pipelineStub(PIPELINE_LABEL, "."), resolver);
try {
builder.build(new StubGoPublisher(), new EnvironmentVariableContext(), taskEntension, null, null, "utf-8");
} catch (CruiseControlException e) {
assertThat(e.getMessage()).contains("Build failed. Command ant reported [BUILD FAILED].");
}
}
Aggregations