use of com.thoughtworks.go.domain.JobResult in project gocd by gocd.
the class Builders method build.
public JobResult build(EnvironmentVariableContext environmentVariableContext) {
JobResult result = JobResult.Passed;
for (Builder builder : builders) {
if (cancelStarted) {
return JobResult.Cancelled;
}
synchronized (this) {
currentBuilder = builder;
}
BuildLogElement buildLogElement = new BuildLogElement();
try {
builder.build(buildLogElement, RunIfConfig.fromJobResult(result.toLowerCase()), goPublisher, environmentVariableContext, taskExtension);
} catch (Exception e) {
result = JobResult.Failed;
}
buildLog.addContent(buildLogElement.getElement());
}
synchronized (this) {
currentBuilder = new NullBuilder();
}
if (cancelStarted) {
return JobResult.Cancelled;
}
return result;
}
use of com.thoughtworks.go.domain.JobResult in project gocd by gocd.
the class BuildResultTypeHandlerCallbackTest method shouldReturnScheduledWhenGivenStringScheduled.
@Test
public void shouldReturnScheduledWhenGivenStringScheduled() throws SQLException {
context.checking(new Expectations() {
{
one(resultGetter).getString();
will(returnValue(JobResult.Passed.toString()));
}
});
JobResult result = (JobResult) callback.getResult(resultGetter);
assertThat(result, is(equal(JobResult.Passed)));
}
use of com.thoughtworks.go.domain.JobResult in project gocd by gocd.
the class BuildRepositoryServiceTest method checkUpdateResult.
private void checkUpdateResult(final String uuid) {
final JobResult result = JobResult.Passed;
context.checking(new Expectations() {
{
one(scheduleService).jobCompleting(jobIdendifier, result, uuid);
}
});
buildRepositoryService.completing(jobIdendifier, result, uuid);
}
use of com.thoughtworks.go.domain.JobResult in project gocd by gocd.
the class GitMaterialUpdaterTest method updateTo.
private void updateTo(GitMaterial material, RevisionContext revisionContext, JobResult expectedResult) {
BuildSession buildSession = newBuildSession();
JobResult result = buildSession.build(new GitMaterialUpdater(material).updateTo("working", revisionContext));
assertThat(buildInfo(), result, is(expectedResult));
}
use of com.thoughtworks.go.domain.JobResult in project gocd by gocd.
the class BuildSessionBasedTestCase method runBuild.
protected void runBuild(BuildSession buildSession, BuildCommand command, JobResult expectedResult) {
JobResult result = buildSession.build(command);
assertThat(buildInfo(), result, is(expectedResult));
}
Aggregations