use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class PipelineInstanceModelTest method shouldUnderstandPipelineStatusMessage.
@Test
public void shouldUnderstandPipelineStatusMessage() throws Exception {
MaterialRevisions revisions = ModificationsMother.modifyOneFile(MaterialsMother.hgMaterials("url"), "revision");
StageInstanceModels stages = new StageInstanceModels();
stages.addStage("unit1", JobHistory.withJob("test", JobState.Completed, JobResult.Passed, new Date()));
stages.addFutureStage("unit2", false);
PipelineInstanceModel model = PipelineInstanceModel.createPipeline("pipeline", -1, "label", BuildCause.createWithModifications(revisions, ""), stages);
assertThat(model.getPipelineStatusMessage(), is("Passed: unit1"));
}
use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class PipelineInstanceModelTest method hgMaterialWithNoModifications.
private PipelineInstanceModel hgMaterialWithNoModifications() {
MaterialRevisions revisions = new MaterialRevisions();
revisions.addRevision(MaterialsMother.hgMaterial(), new ArrayList<>());
PipelineInstanceModel model = PipelineInstanceModel.createPipeline("pipeline", -1, "label", null, new StageInstanceModels());
model.setLatestRevisions(revisions);
return model;
}
use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class PipelineInstanceModelTest method shouldGetCurrentMaterialRevisionForMaterial.
@Test
public void shouldGetCurrentMaterialRevisionForMaterial() {
MaterialRevisions revisions = new MaterialRevisions();
HgMaterial material = MaterialsMother.hgMaterial();
revisions.addRevision(material, HG_MATERIAL_MODIFICATION);
PipelineInstanceModel model = PipelineInstanceModel.createPipeline("pipeline", -1, "label", BuildCause.createWithModifications(revisions, ""), new StageInstanceModels());
assertThat(model.findCurrentMaterialRevisionForUI(material.config()), is(revisions.getMaterialRevision(0)));
}
use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class PipelineInstanceModelTest method shouldGetCurrentRevisionForMaterialByName.
@Test
public void shouldGetCurrentRevisionForMaterialByName() {
MaterialRevisions revisions = new MaterialRevisions();
HgMaterial material = MaterialsMother.hgMaterial();
SvnMaterial svnMaterial = MaterialsMother.svnMaterial();
material.setName(new CaseInsensitiveString("hg_material"));
revisions.addRevision(svnMaterial, new Modification(new Date(), "1024", "MOCK_LABEL-12", null));
revisions.addRevision(material, HG_MATERIAL_MODIFICATION);
BuildCause buildCause = BuildCause.createWithModifications(revisions, "");
PipelineInstanceModel model = PipelineInstanceModel.createPipeline("pipeline", -1, "label", buildCause, new StageInstanceModels());
assertThat(model.getCurrentRevision("hg_material").getRevision(), is("a087402bd2a7828a130c1bdf43f2d9ef8f48fd46"));
}
use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class PipelineInstanceModelTest method setUpModificationForHgMaterial.
private PipelineInstanceModel setUpModificationForHgMaterial() {
MaterialRevisions revisions = new MaterialRevisions();
revisions.addRevision(MaterialsMother.hgMaterial(), HG_MATERIAL_MODIFICATION);
PipelineInstanceModel model = PipelineInstanceModel.createPipeline("pipeline", -1, "label", null, new StageInstanceModels());
model.setLatestRevisions(revisions);
return model;
}
Aggregations