Search in sources :

Example 1 with SvnTestRepo

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

the class SvnMultipleMaterialsTest method createRepo.

@Before
public void createRepo() throws IOException {
    repo = new SvnTestRepo();
    pipelineDir = TestFileUtil.createTempFolder("working-dir-" + UUID.randomUUID());
}
Also used : SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) Before(org.junit.Before)

Example 2 with SvnTestRepo

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

the class PipelineScheduleServiceTest method setup.

@Before
public void setup() throws Exception {
    configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(goConfigDao);
    configHelper.onSetUp();
    testRepo = new SvnTestRepo("testSvnRepo");
    dbHelper.onSetUp();
    repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
    mingleConfig = configHelper.addPipeline("mingle", STAGE_NAME, repository, "unit", "functional");
    goConfig = configHelper.addPipeline("go", STAGE_NAME, repository, "unit");
    StageConfig ftStageConfig = StageConfigMother.custom("ft", "twist");
    ftStageConfig.jobConfigByConfigName(new CaseInsensitiveString("twist")).addVariable("JOB_LVL", "job value");
    ftStageConfig.setVariables(env("STAGE_LVL", "stage value"));
    configHelper.addStageToPipeline("go", ftStageConfig);
    configHelper.addEnvironmentVariableToPipeline("go", env("PIPELINE_LVL", "pipeline value"));
    configHelper.addEnvironments("uat");
    EnvironmentConfig uatEnv = configHelper.currentConfig().getEnvironments().named(new CaseInsensitiveString("uat"));
    uatEnv.addPipeline(new CaseInsensitiveString("go"));
    uatEnv.addEnvironmentVariable("ENV_LVL", "env value");
    evolveConfig = configHelper.addPipeline("evolve", STAGE_NAME, repository, "unit");
    goCache.clear();
}
Also used : EnvironmentConfig(com.thoughtworks.go.config.EnvironmentConfig) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) StageConfig(com.thoughtworks.go.config.StageConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Before(org.junit.Before)

Example 3 with SvnTestRepo

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

the class TwoPipelineGroups method onSetUp.

public void onSetUp() throws Exception {
    this.isSetup = true;
    configHelper.initializeConfigFile();
    svnTestRepo = new SvnTestRepo("testsvnrepo");
    SvnCommand svnCommand = new SvnCommand(null, svnTestRepo.projectRepositoryUrl());
    configHelper.addPipelineWithGroup("group1", "pipeline_" + UUID.randomUUID(), svnCommand, "defaultStage", "defaultJob");
    configHelper.addPipelineWithGroup("group2", "pipeline_" + UUID.randomUUID(), svnCommand, "defaultStage", "defaultJob");
}
Also used : SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand)

Example 4 with SvnTestRepo

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

the class BuildCauseProducerServiceIntegrationTest method setup.

@Before
public void setup() throws Exception {
    diskSpaceSimulator = new DiskSpaceSimulator();
    new HgTestRepo("testHgRepo");
    svnRepository = new SvnTestRepo("testSvnRepo");
    dbHelper.onSetUp();
    configHelper.onSetUp();
    configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
    repository = new SvnCommand(null, svnRepository.projectRepositoryUrl());
    goParentPipelineConfig = configHelper.addPipeline(GO_PIPELINE_UPSTREAM, STAGE_NAME, new MaterialConfigs(new GitMaterialConfig("foo-bar")), "unit");
    goPipelineConfig = configHelper.addPipeline(GO_PIPELINE_NAME, STAGE_NAME, repository, "unit");
    svnMaterialRevs = new MaterialRevisions();
    SvnMaterial svnMaterial = SvnMaterial.createSvnMaterialWithMock(repository);
    svnMaterialRevs.addRevision(svnMaterial, svnMaterial.latestModification(null, new ServerSubprocessExecutionContext(goConfigService, new SystemEnvironment())));
    final MaterialRevisions materialRevisions = new MaterialRevisions();
    SvnMaterial anotherSvnMaterial = SvnMaterial.createSvnMaterialWithMock(repository);
    materialRevisions.addRevision(anotherSvnMaterial, anotherSvnMaterial.latestModification(null, subprocessExecutionContext));
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {

        @Override
        protected void doInTransactionWithoutResult(TransactionStatus status) {
            materialRepository.save(svnMaterialRevs);
        }
    });
    BuildCause buildCause = BuildCause.createWithModifications(svnMaterialRevs, "");
    mingleConfig = configHelper.addPipeline(MINGLE_PIPELINE_NAME, STAGE_NAME, repository, new Filter(new IgnoredFiles("**/*.doc")), "unit", "functional");
    latestPipeline = PipelineMother.schedule(this.mingleConfig, buildCause);
    latestPipeline = pipelineDao.saveWithStages(latestPipeline);
    dbHelper.passStage(latestPipeline.getStages().first());
    pipelineScheduleQueue.clear();
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) MaterialRevisions(com.thoughtworks.go.domain.MaterialRevisions) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) TransactionStatus(org.springframework.transaction.TransactionStatus) HgTestRepo(com.thoughtworks.go.helper.HgTestRepo) BuildCause(com.thoughtworks.go.domain.buildcause.BuildCause) SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) GitMaterialConfig(com.thoughtworks.go.config.materials.git.GitMaterialConfig) Filter(com.thoughtworks.go.config.materials.Filter) IgnoredFiles(com.thoughtworks.go.config.materials.IgnoredFiles) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) TransactionCallbackWithoutResult(org.springframework.transaction.support.TransactionCallbackWithoutResult) Before(org.junit.Before)

Example 5 with SvnTestRepo

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

the class BuildCauseProducerServiceWithFlipModificationTest method setup.

@Before
public void setup() throws Exception {
    configHelper = new GoConfigFileHelper();
    dbHelper.onSetUp();
    configHelper.onSetUp();
    configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
    svnRepository = new SvnTestRepo("testSvnRepo");
    hgTestRepo = new HgTestRepo("testHgRepo");
    repository = new SvnCommand(null, svnRepository.projectRepositoryUrl());
    svnMaterialConfig = new SvnMaterialConfig(repository.getUrl().forCommandline(), repository.getUserName(), repository.getPassword(), repository.isCheckExternals());
}
Also used : SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) HgTestRepo(com.thoughtworks.go.helper.HgTestRepo) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) 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