use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class SvnMaterialTest method shouldBeEqualWhenUrlSameForSvnMaterial.
@Test
public void shouldBeEqualWhenUrlSameForSvnMaterial() throws Exception {
final Material material1 = MaterialsMother.defaultSvnMaterialsWithUrl("url1").get(0);
final Material material = MaterialsMother.defaultSvnMaterialsWithUrl("url1").get(0);
assertComplementaryEquals(material1, material, true);
}
use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class TfsMaterialInstanceTest method shouldPassFolderAlong.
@Test
public void shouldPassFolderAlong() {
TfsMaterialInstance instance1 = new TfsMaterialInstance("http://foo.com", "username", "CORPORATE", "some_project_path", "blah");
Material material = instance1.toOldMaterial("", "some_folder", "password");
assertThat(material.getFolder(), is("some_folder"));
}
use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class PipelineMaterialRevisionTest method shouldUsePassedInFROMRevisionWhenSCMMaterial.
@Test
public void shouldUsePassedInFROMRevisionWhenSCMMaterial() {
Material material = new HgMaterial("http://some_server/repo", null);
Modification latestModification = modification(new Date(), "123", null, null);
Modification earlierModification = modification(new Date(), "23", null, null);
PipelineMaterialRevision pmr = new PipelineMaterialRevision(9, new MaterialRevision(material, latestModification, earlierModification), null);
Modification earlierThatEarlyModification = modification(new Date(), "13", null, null);
pmr.useMaterialRevision(new MaterialRevision(material, latestModification, earlierThatEarlyModification));
assertThat(pmr.getToModification(), is(latestModification));
assertThat(pmr.getFromModification(), is(earlierThatEarlyModification));
Modification laterThanLatestModification = modification(new Date(), "1234", null, null);
pmr.useMaterialRevision(new MaterialRevision(material, laterThanLatestModification, earlierThatEarlyModification));
assertThat(pmr.getToModification(), is(laterThanLatestModification));
assertThat(pmr.getFromModification(), is(earlierThatEarlyModification));
pmr.useMaterialRevision(new MaterialRevision(material, laterThanLatestModification, earlierModification));
assertThat(pmr.getToModification(), is(laterThanLatestModification));
assertThat(pmr.getFromModification(), is(earlierModification));
}
use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class PipelineHistoryMother method pipelineHistory.
public static PipelineInstanceModels pipelineHistory(PipelineConfig pipelineConfig, Date scheduleDate, Date modificationDate, String revision, String committer, String commitMessage, String commiterEmail, String commitedFileName, String dirModified, String label) {
PipelineInstanceModels history = PipelineInstanceModels.createPipelineInstanceModels();
Modification modification = new Modification(committer, commitMessage, commiterEmail, modificationDate, revision);
modification.createModifiedFile(commitedFileName, dirModified, ModifiedAction.added);
MaterialRevisions revisions = new MaterialRevisions();
Material material = new MaterialConfigConverter().toMaterial(pipelineConfig.materialConfigs().first());
material.setId(10);
revisions.addRevision(material, modification);
BuildCause buildCause = BuildCause.createManualForced(revisions, Username.ANONYMOUS);
PipelineInstanceModel item = PipelineInstanceModel.createPipeline(CaseInsensitiveString.str(pipelineConfig.name()), -1, label, buildCause, stageHistory(pipelineConfig, scheduleDate));
item.setCounter(1);
item.setId(1);
item.setComment("build comment");
history.add(item);
return history;
}
use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class MaterialUpdateListener method onMessage.
public void onMessage(MaterialUpdateMessage message) {
final Material material = message.getMaterial();
try {
mduPerformanceLogger.pickedUpMaterialForMDU(message.trackingId(), material);
bombIf(diskSpaceMonitor.isLowOnDisk(), "Cruise server is too low on disk to continue with material update");
updater.updateMaterial(material);
mduPerformanceLogger.postingMessageAboutMDUCompletion(message.trackingId(), material);
// This should happen only if the transaction is committed.
topic.post(new MaterialUpdateSuccessfulMessage(material, message.trackingId()));
} catch (Exception e) {
topic.post(new MaterialUpdateFailedMessage(material, message.trackingId(), e));
mduPerformanceLogger.postingMessageAboutMDUFailure(message.trackingId(), material);
}
}
Aggregations