Search in sources :

Example 1 with SvnTestRepoWithExternal

use of com.thoughtworks.go.helper.SvnTestRepoWithExternal 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));
}
Also used : MaterialRevisions(com.thoughtworks.go.domain.MaterialRevisions) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) SvnTestRepoWithExternal(com.thoughtworks.go.helper.SvnTestRepoWithExternal) Test(org.junit.Test)

Example 2 with SvnTestRepoWithExternal

use of com.thoughtworks.go.helper.SvnTestRepoWithExternal in project gocd by gocd.

the class SvnExternalTest method copyRepository.

@BeforeClass
public static void copyRepository() throws IOException {
    svnRepo = new SvnTestRepoWithExternal(temporaryFolder);
    workingDir = svnRepo.projectRepositoryUrlAsFile();
}
Also used : SvnTestRepoWithExternal(com.thoughtworks.go.helper.SvnTestRepoWithExternal)

Example 3 with SvnTestRepoWithExternal

use of com.thoughtworks.go.helper.SvnTestRepoWithExternal in project gocd by gocd.

the class MaterialDatabaseSvnWithExternalsUpdaterTest method shouldDetectChangesToExternals.

@Test
public void shouldDetectChangesToExternals() throws Exception {
    ((SvnTestRepoWithExternal) testRepo).checkInExternalFile("external.txt", "EXTERNAL");
    updater.updateMaterial(material);
    MaterialRevisions materialRevisions = materialRepository.findLatestModification(material);
    assertThat(materialRevisions.numberOfRevisions(), is(2));
    assertThat(materialRevisions.getMaterialRevision(1).getModification(0).getComment(), is("EXTERNAL"));
}
Also used : MaterialRevisions(com.thoughtworks.go.domain.MaterialRevisions) SvnTestRepoWithExternal(com.thoughtworks.go.helper.SvnTestRepoWithExternal) Test(org.junit.Test)

Aggregations

SvnTestRepoWithExternal (com.thoughtworks.go.helper.SvnTestRepoWithExternal)3 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)2 Test (org.junit.Test)2 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)1