Search in sources :

Example 1 with JobHistory

use of com.thoughtworks.go.presentation.pipelinehistory.JobHistory in project gocd by gocd.

the class StageMother method toStageInstanceModel.

public static StageInstanceModel toStageInstanceModel(Stage stage) {
    StageInstanceModel stageInstanceModel = new StageInstanceModel(stage.getName(), String.valueOf(stage.getCounter()), stage.getResult(), stage.getIdentifier());
    stageInstanceModel.setApprovalType(stage.getApprovalType());
    stageInstanceModel.setApprovedBy(stage.getApprovedBy());
    stageInstanceModel.setRerunOfCounter(stage.getRerunOfCounter());
    JobHistory jobHistory = new JobHistory();
    for (JobInstance jobInstance : stage.getJobInstances()) {
        jobHistory.addJob(jobInstance.getName(), jobInstance.getState(), jobInstance.getResult(), jobInstance.getScheduledDate());
    }
    stageInstanceModel.setBuildHistory(jobHistory);
    return stageInstanceModel;
}
Also used : JobHistory(com.thoughtworks.go.presentation.pipelinehistory.JobHistory) StageInstanceModel(com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModel)

Example 2 with JobHistory

use of com.thoughtworks.go.presentation.pipelinehistory.JobHistory in project gocd by gocd.

the class ViewCacheKeyTest method stageInstance.

private StageInstanceModel stageInstance(String name, int id, JobState state, JobResult jobResult) {
    JobHistory jobs = new JobHistory();
    jobs.addJob("dev", state, jobResult, new Date());
    StageInstanceModel stageInstance = new StageInstanceModel(name, "2", jobs);
    stageInstance.setId(id);
    return stageInstance;
}
Also used : JobHistory(com.thoughtworks.go.presentation.pipelinehistory.JobHistory) StageInstanceModel(com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModel) Date(java.util.Date)

Aggregations

JobHistory (com.thoughtworks.go.presentation.pipelinehistory.JobHistory)2 StageInstanceModel (com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModel)2 Date (java.util.Date)1