Search in sources :

Example 11 with SvnCommand

use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.

the class BuildWorkEnvironmentVariablesTest method shouldSetEnvironmentVariableForSvnExternal.

@Test
public void shouldSetEnvironmentVariableForSvnExternal() throws Exception {
    svnRepoFixture.createExternals(svnRepoFixture.getEnd2EndRepoUrl());
    command = new SvnCommand(null, svnRepoFixture.getEnd2EndRepoUrl(), null, null, true);
    svnMaterial = SvnMaterial.createSvnMaterialWithMock(command);
    svnMaterial.setFolder("svn-Dir");
    EnvironmentVariableContext environmentVariableContext = doWorkWithMaterials(new Materials(svnMaterial));
    assertThat(environmentVariableContext.getProperty("GO_REVISION_SVN_DIR"), is("4"));
    assertThat(environmentVariableContext.getProperty("GO_REVISION_SVN_DIR_EXTERNAL"), is("4"));
}
Also used : Materials(com.thoughtworks.go.config.materials.Materials) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) EnvironmentVariableContext(com.thoughtworks.go.util.command.EnvironmentVariableContext) Test(org.junit.Test)

Example 12 with SvnCommand

use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.

the class BuildWorkEnvironmentVariablesTest method setUp.

@Before
public void setUp() throws IOException {
    initMocks(this);
    dir = new File("someFolder");
    environmentVariableContext = new EnvironmentVariableContext();
    svnRepoFixture = new SvnRepoFixture("../common/test-resources/unit/data/svnrepo");
    svnRepoFixture.createRepository();
    command = new SvnCommand(null, svnRepoFixture.getEnd2EndRepoUrl());
    pipelineConfig = PipelineConfigMother.createPipelineConfig(PIPELINE_NAME, STAGE_NAME, JOB_NAME);
    svnMaterial = SvnMaterial.createSvnMaterialWithMock(command);
    dependencyMaterial = new DependencyMaterial(new CaseInsensitiveString("upstream1"), new CaseInsensitiveString(STAGE_NAME));
    dependencyMaterialWithName = new DependencyMaterial(new CaseInsensitiveString("upstream2"), new CaseInsensitiveString(STAGE_NAME));
    dependencyMaterialWithName.setName(new CaseInsensitiveString("dependency_material_name"));
    setupHgRepo();
}
Also used : SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) EnvironmentVariableContext(com.thoughtworks.go.util.command.EnvironmentVariableContext) File(java.io.File) SvnRepoFixture(com.thoughtworks.go.utils.SvnRepoFixture) Before(org.junit.Before)

Example 13 with SvnCommand

use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.

the class BuildWorkArtifactUploadingTest method setUp.

@Before
public void setUp() throws IOException {
    initMocks(this);
    buildWorkingDirectory = new File("tmp" + UUID.randomUUID());
    environmentVariableContext = new EnvironmentVariableContext();
    svnRepoFixture = new SvnRepoFixture("../common/test-resources/unit/data/svnrepo");
    svnRepoFixture.createRepository();
    SvnCommand command = new SvnCommand(null, svnRepoFixture.getEnd2EndRepoUrl());
    PipelineConfigMother.createPipelineConfig(PIPELINE_NAME, STAGE_NAME, JOB_NAME);
    svnMaterial = SvnMaterial.createSvnMaterialWithMock(command);
    new SystemEnvironment().setProperty("serviceUrl", "some_random_place");
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) EnvironmentVariableContext(com.thoughtworks.go.util.command.EnvironmentVariableContext) File(java.io.File) SvnRepoFixture(com.thoughtworks.go.utils.SvnRepoFixture) Before(org.junit.Before)

Example 14 with SvnCommand

use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.

the class SvnTestRepoWithExternal method commitToExternalRepo.

private void commitToExternalRepo(String externalUrl) throws IOException {
    File folder = TestFileUtil.createTempFolder("testSvnExternalWorkingCopy");
    try {
        SvnCommand repository = getSvnExternalCommand(externalUrl, false);
        repository.checkoutTo(outputStreamConsumer, folder, SubversionRevision.HEAD);
        repository.propset(folder, "newPropetyForExternal", "any value");
        repository.commit(inMemoryConsumer(), folder, "make change");
    } finally {
        FileUtil.deleteFolder(folder);
    }
}
Also used : SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) File(java.io.File)

Example 15 with SvnCommand

use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.

the class ScheduleServiceIntegrationTest method setup.

@Before
public void setup() throws Exception {
    configHelper = new GoConfigFileHelper();
    dbHelper.onSetUp();
    configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
    configHelper.onSetUp();
    pipelineFixture = new PipelineWithTwoStages(materialRepository, transactionTemplate);
    pipelineFixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
    mingleConfig = configHelper.addPipeline("mingle", STAGE_NAME, repository, JOB_NAME, "functional");
    goConfigService.forceNotifyListeners();
    agentAssignment.clear();
    goCache.clear();
}
Also used : PipelineWithTwoStages(com.thoughtworks.go.fixture.PipelineWithTwoStages) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper)

Aggregations

SvnCommand (com.thoughtworks.go.domain.materials.svn.SvnCommand)25 SvnTestRepo (com.thoughtworks.go.helper.SvnTestRepo)9 Before (org.junit.Before)8 GoConfigFileHelper (com.thoughtworks.go.util.GoConfigFileHelper)5 Test (org.junit.Test)5 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)4 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)4 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)4 Subversion (com.thoughtworks.go.domain.materials.svn.Subversion)4 PipelineWithTwoStages (com.thoughtworks.go.fixture.PipelineWithTwoStages)3 TestRepo (com.thoughtworks.go.helper.TestRepo)3 EnvironmentVariableContext (com.thoughtworks.go.util.command.EnvironmentVariableContext)3 File (java.io.File)3 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)2 BuildCause (com.thoughtworks.go.domain.buildcause.BuildCause)2 HgTestRepo (com.thoughtworks.go.helper.HgTestRepo)2 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)2 SvnRepoFixture (com.thoughtworks.go.utils.SvnRepoFixture)2 Date (java.util.Date)2 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1