Search in sources :

Example 6 with SvnTestRepo

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

the class ChangeMaterialsTest method setUp.

@Before
public void setUp() throws Exception {
    username = new Username(new CaseInsensitiveString("gli"));
    dbHelper.onSetUp();
    cruiseConfig = new GoConfigFileHelper().usingCruiseConfigDao(goConfigDao);
    cruiseConfig.onSetUp();
    cruiseConfig.initializeConfigFile();
    hgTestRepo = new HgTestRepo();
    SvnTestRepo svnRepo = new SvnTestRepo();
    cruiseConfig.addPipeline(PIPELINE_NAME, DEV_STAGE, svnRepo.materialConfig(), "foo");
    mingle = cruiseConfig.addStageToPipeline(PIPELINE_NAME, FT_STAGE, "bar");
    pipeline = dbHelper.newPipelineWithAllStagesPassed(mingle);
    listener = new StubScheduleCheckCompletedListener();
    topic.addListener(listener);
}
Also used : StubScheduleCheckCompletedListener(com.thoughtworks.go.server.messaging.StubScheduleCheckCompletedListener) Username(com.thoughtworks.go.server.domain.Username) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) HgTestRepo(com.thoughtworks.go.helper.HgTestRepo) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Before(org.junit.Before)

Example 7 with SvnTestRepo

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

the class SvnCommandTest method shouldRecogniseSvnAsTheSameIfURLUsesFileProtocol.

@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { DO_NOT_RUN_ON, WINDOWS })
public void shouldRecogniseSvnAsTheSameIfURLUsesFileProtocol() throws Exception {
    SvnTestRepo repo = new SvnTestRepo("svnRepo");
    File working = TestFileUtil.createTempFolder("someDir");
    SvnMaterial material = repo.material();
    InMemoryStreamConsumer output = new InMemoryStreamConsumer();
    material.freshCheckout(output, new SubversionRevision("3"), working);
    assertThat(output.getAllOutput(), containsString("Checked out revision 3"));
    InMemoryStreamConsumer output2 = new InMemoryStreamConsumer();
    updateMaterial(material, new SubversionRevision("4"), working, output2);
    assertThat(output2.getAllOutput(), containsString("Updated to revision 4"));
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) File(java.io.File) RunIf(com.googlecode.junit.ext.RunIf) Test(org.junit.Test)

Example 8 with SvnTestRepo

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

the class SvnCommandTest method shouldRecogniseSvnAsTheSameIfURLContainsSpaces.

@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { DO_NOT_RUN_ON, WINDOWS })
public void shouldRecogniseSvnAsTheSameIfURLContainsSpaces() throws Exception {
    File working = TestFileUtil.createTempFolder("shouldRecogniseSvnAsTheSameIfURLContainsSpaces");
    SvnTestRepo repo = new SvnTestRepo("a directory with spaces");
    SvnMaterial material = repo.material();
    assertThat(material.getUrl(), containsString("%20"));
    InMemoryStreamConsumer output = new InMemoryStreamConsumer();
    material.freshCheckout(output, new SubversionRevision("3"), working);
    assertThat(output.getAllOutput(), containsString("Checked out revision 3"));
    InMemoryStreamConsumer output2 = new InMemoryStreamConsumer();
    material.updateTo(output2, working, new RevisionContext(new SubversionRevision("4")), new TestSubprocessExecutionContext());
    assertThat(output2.getAllOutput(), containsString("Updated to revision 4"));
}
Also used : SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) File(java.io.File) RunIf(com.googlecode.junit.ext.RunIf) Test(org.junit.Test)

Example 9 with SvnTestRepo

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

the class MixedMultipleMaterialsTest method createRepo.

@Before
public void createRepo() throws IOException {
    svnRepo = new SvnTestRepo();
    hgRepo = new HgTestRepo();
    gitRepo = new GitTestRepo();
    pipelineDir = TestFileUtil.createTempFolder("working-dir-" + UUID.randomUUID());
}
Also used : GitTestRepo(com.thoughtworks.go.domain.materials.git.GitTestRepo) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) HgTestRepo(com.thoughtworks.go.helper.HgTestRepo) Before(org.junit.Before)

Example 10 with SvnTestRepo

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

the class SvnCommandTest method setup.

@Before
public void setup() throws IOException {
    testRepo = new SvnTestRepo();
    svnRepositoryUrl = testRepo.projectRepositoryUrl();
    subversion = new SvnCommand(null, svnRepositoryUrl, "user", "pass", false);
    outputStreamConsumer = inMemoryConsumer();
    checkoutFolder = TestFileUtil.createUniqueTempFile("workingcopy" + System.currentTimeMillis());
}
Also used : SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) Before(org.junit.Before)

Aggregations

SvnTestRepo (com.thoughtworks.go.helper.SvnTestRepo)18 SvnCommand (com.thoughtworks.go.domain.materials.svn.SvnCommand)9 Before (org.junit.Before)9 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)5 HgTestRepo (com.thoughtworks.go.helper.HgTestRepo)5 Test (org.junit.Test)5 RunIf (com.googlecode.junit.ext.RunIf)3 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)3 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)3 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)3 TestRepo (com.thoughtworks.go.helper.TestRepo)3 GoConfigFileHelper (com.thoughtworks.go.util.GoConfigFileHelper)3 File (java.io.File)3 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)2 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)2 EnvironmentConfig (com.thoughtworks.go.config.EnvironmentConfig)1 StageConfig (com.thoughtworks.go.config.StageConfig)1 Filter (com.thoughtworks.go.config.materials.Filter)1 IgnoredFiles (com.thoughtworks.go.config.materials.IgnoredFiles)1 Materials (com.thoughtworks.go.config.materials.Materials)1