use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class BuildCauseProducerServiceWithFlipModificationTest method preparePipelineWithMaterial.
private void preparePipelineWithMaterial() throws Exception {
SvnMaterial svnMaterial = SvnMaterial.createSvnMaterialWithMock(repository);
ReflectionUtil.setField(svnMaterial, ScmMaterialConfig.FOLDER, "asc");
ReflectionUtil.invoke(svnMaterial, "resetCachedIdentityAttributes");
MaterialConfigs materialConfigs = new MaterialConfigs();
materialConfigs.add(svnMaterial.config());
configHelper.addPipeline("cruise", STAGE_NAME, materialConfigs, "unit", "functional");
MaterialRevisions materialRevisions = new MaterialRevisions();
materialRevisions.addRevision(svnMaterial, svnMaterial.latestModification(null, subprocessExecutionContext));
}
use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class BuildCauseProducerServiceWithFlipModificationTest method buildCause.
private BuildCause buildCause() {
MaterialRevisions materialRevisions = new MaterialRevisions();
SvnMaterial svnMaterial = SvnMaterial.createSvnMaterialWithMock(repository);
materialRevisions.addRevision(svnMaterial, svnMaterial.latestModification(null, subprocessExecutionContext));
return BuildCause.createWithModifications(materialRevisions, "");
}
use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class ChangeMaterialsTest method shouldManualScheduleWithLatestModificationFromNewMaterialAfterChangedMaterial.
// TODO: CS&DY Revisit this test to use materials properly
@Test
public void shouldManualScheduleWithLatestModificationFromNewMaterialAfterChangedMaterial() throws Exception, StageAlreadyBuildingException {
cruiseConfig.replaceMaterialWithHgRepoForPipeline(PIPELINE_NAME, hgTestRepo.projectRepositoryUrl());
scheduleHelper.manuallySchedulePipelineWithRealMaterials(PIPELINE_NAME, username);
scheduleService.autoSchedulePipelinesFromRequestBuffer();
Pipeline mostRecent = pipelineService.mostRecentFullPipelineByName(PIPELINE_NAME);
assertThat("Should schedule new instance after changed material", mostRecent.getId(), is(not(pipeline.getId())));
MaterialRevisions materialRevisions = mostRecent.getBuildCause().getMaterialRevisions();
assertEquals(hgTestRepo.latestModifications().get(0).getModifiedTime(), materialRevisions.getDateOfLatestModification());
}
use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class MaterialDatabaseGitWithSubmodulesUpdaterTest method shouldUpdateModificationsForExternalsAsWell.
@Test
public void shouldUpdateModificationsForExternalsAsWell() throws Exception {
updater.updateMaterial(material);
MaterialRevisions materialRevisions = materialRepository.findLatestModification(material);
assertThat(materialRevisions.numberOfRevisions(), is(1));
}
use of com.thoughtworks.go.domain.MaterialRevisions in project gocd by gocd.
the class MaterialDatabaseSvnWithExternalsUpdaterTest method shouldUpdateModificationsForExternals.
@Test
public void shouldUpdateModificationsForExternals() throws Exception {
updater.updateMaterial(material);
testRepoWithExternal.checkInExternalFile("foo_bar", "foo bar quux");
updater.updateMaterial(material);
MaterialRevisions materialRevisions = materialRepository.findLatestModification(material);
assertThat(materialRevisions.numberOfRevisions(), is(2));
SvnMaterial externalMaterial = testRepoWithExternal.externalMaterial();
MaterialRevision revisionForExternal = materialRevisions.findRevisionFor(externalMaterial);
assertThat(revisionForExternal.getModification(0).getComment(), is("foo bar quux"));
}
Aggregations