use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class StageConverter method createStageDTO.
private StageNotificationDTO.StageDTO createStageDTO() {
ArrayList<StageNotificationDTO.JobDTO> jobs = new ArrayList<>();
for (JobInstance job : stage.getJobInstances()) {
StageNotificationDTO.JobDTO jobDTO = new StageNotificationDTO.JobDTO(job.getName(), job.getScheduledDate(), job.getCompletedDate(), job.getState(), job.getResult(), job.getAgentUuid());
jobs.add(jobDTO);
}
return new StageNotificationDTO.StageDTO(stage.getName(), stage.getCounter(), stage.getApprovalType(), stage.getApprovedBy(), stage.getState(), stage.getResult(), stage.getCreatedTime(), stage.getLastTransitionedTime(), jobs);
}
use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class StageConverter method createStageDTO.
private StageNotificationDTO.StageDTO createStageDTO() {
ArrayList<StageNotificationDTO.JobDTO> jobs = new ArrayList<>();
for (JobInstance job : stage.getJobInstances()) {
StageNotificationDTO.JobDTO jobDTO = new StageNotificationDTO.JobDTO(job.getName(), job.getScheduledDate(), job.getAssignedDate(), job.getCompletedDate(), job.getState(), job.getResult(), job.getAgentUuid());
jobs.add(jobDTO);
}
return new StageNotificationDTO.StageDTO(stage.getName(), stage.getCounter(), stage.getApprovalType(), stage.getApprovedBy(), stage.getState(), stage.getResult(), stage.getCreatedTime(), stage.getLastTransitionedTime(), jobs);
}
use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class StageConverter method createStageDTO.
private StageNotificationDTO.StageDTO createStageDTO() {
ArrayList<StageNotificationDTO.JobDTO> jobs = new ArrayList<>();
for (JobInstance job : stage.getJobInstances()) {
StageNotificationDTO.JobDTO jobDTO = new StageNotificationDTO.JobDTO(job.getName(), DateUtil.dateToString(job.getScheduledDate()), DateUtil.dateToString(job.getAssignedDate()), DateUtil.dateToString(job.getCompletedDate()), job.getState(), job.getResult(), job.getAgentUuid());
jobs.add(jobDTO);
}
return new StageNotificationDTO.StageDTO(stage.getName(), stage.getCounter(), stage.getApprovalType(), stage.getApprovedBy(), stage.getState(), stage.getResult(), DateUtil.dateToString(stage.getCreatedTime()), DateUtil.dateToString(stage.getLastTransitionedTime()), jobs);
}
use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class ScheduleServiceRescheduleHungJobsTest method shouldRescheduleHungBuildForDeadAgent.
@Test
public void shouldRescheduleHungBuildForDeadAgent() {
final JobInstance jobInstance = JobInstanceMother.assigned("dev");
when(agentService.findRegisteredAgents()).thenReturn(activities());
when(jobInstanceService.findHungJobs(Arrays.asList("uuid1", "uuid2"))).thenReturn(new JobInstances(jobInstance));
scheduleService.rescheduleHungJobs();
verify(agentService).findRegisteredAgents();
verify(jobInstanceService).findHungJobs(Arrays.asList("uuid1", "uuid2"));
}
use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class PipelineBuilder method addJob.
public void addJob(String jobName) {
JobInstance instance = new JobInstance(jobName, new TimeProvider());
currentStage().getJobInstances().add(instance);
}
Aggregations