use of com.thoughtworks.go.config.materials.svn.SvnMaterial 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"));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.
the class MaterialDatabaseSvnWithExternalsUpdaterTest method shouldNotTryToSaveModificationForAnExternalThathasAlreadyBeenSaved.
@Test
public void shouldNotTryToSaveModificationForAnExternalThathasAlreadyBeenSaved() throws Exception {
updater.updateMaterial(material);
SvnTestRepoWithExternal otherRepo = new SvnTestRepoWithExternal(testRepoWithExternal.externalRepositoryUrl(), temporaryFolder);
SvnMaterial otherMaterial = new SvnMaterial(otherRepo.projectRepositoryUrl(), null, null, true);
updater.updateMaterial(otherMaterial);
MaterialRevisions materialRevisions = materialRepository.findLatestModification(otherMaterial);
assertThat(materialRevisions.numberOfRevisions(), is(2));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.
the class MaterialRepositoryIntegrationTest method findLatestModifications_shouldQueryIfNotEnoughElementsInCache_Integration.
@Test
public void findLatestModifications_shouldQueryIfNotEnoughElementsInCache_Integration() {
SvnMaterial material = MaterialsMother.svnMaterial();
MaterialRevision mod = saveOneScmModification(material, "user2", "file3");
goCache.clear();
Modification modification = repo.findLatestModification(repo.findMaterialInstance(material));
assertEquals(mod.getLatestModification(), modification);
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.
the class MaterialRepositoryIntegrationTest method shouldBeAbleToFindModificationsSinceAPreviousChange.
@Test
public void shouldBeAbleToFindModificationsSinceAPreviousChange() throws Exception {
SvnMaterial original = MaterialsMother.svnMaterial();
MaterialRevision originalRevision = saveOneScmModification(original, "user1", "file1");
MaterialRevision later = saveOneScmModification(original, "user2", "file2");
List<Modification> modifications = repo.findModificationsSince(original, originalRevision);
assertEquals(later.getLatestModification(), modifications.get(0));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterial in project gocd by gocd.
the class MaterialRepositoryIntegrationTest method shouldFindNoModificationsSinceLatestChange.
@Test
public void shouldFindNoModificationsSinceLatestChange() throws Exception {
SvnMaterial original = MaterialsMother.svnMaterial();
MaterialRevision originalRevision = saveOneScmModification(original, "user", "file1");
List<Modification> modifications = repo.findModificationsSince(original, originalRevision);
assertThat(modifications.size(), is(0));
}
Aggregations