use of com.thoughtworks.go.domain.materials.svn.SvnCommand 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();
}
use of com.thoughtworks.go.domain.materials.svn.SvnCommand 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());
}
use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.
the class SvnPostCommitHookImplementerTest method shouldReturnEmptySvnCommand.
@Test
public void shouldReturnEmptySvnCommand() {
final SvnCommand svnCommand = implementer.getEmptySvnCommand();
assertThat(svnCommand instanceof SvnCommand, is(true));
assertThat(svnCommand.getUrl().toString(), is("."));
}
use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.
the class MaterialExpansionServiceCachingTest method shouldCacheSvnMaterialCheckExternalCommand.
@Test
public void shouldCacheSvnMaterialCheckExternalCommand() {
SvnMaterialConfig svnMaterialConfig = svnMaterialConfig(svnRepo.projectRepositoryUrl(), "mainRepo");
MaterialConfigs materialConfigs = new MaterialConfigs();
String cacheKey = (MaterialExpansionService.class + "_cacheKeyForSvnMaterialCheckExternalCommand_" + svnMaterialConfig.getFingerprint()).intern();
Subversion svn = (SvnCommand) goCache.get(cacheKey);
assertNull(svn);
materialExpansionService.expandForScheduling(svnMaterialConfig, materialConfigs);
svn = (SvnCommand) goCache.get(cacheKey);
assertNotNull(svn);
assertThat(svn.getUrl().forCommandline(), is(svnMaterialConfig.getUrl()));
}
use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method materialRevisions.
private MaterialRevisions materialRevisions() {
MaterialRevision svnRevision = new MaterialRevision(this.svnMaterial, ModificationsMother.oneModifiedFile(svnRepoFixture.getHeadRevision(svnRepoFixture.getEnd2EndRepoUrl())));
SvnMaterial svnMaterialForExternal = SvnMaterial.createSvnMaterialWithMock(new SvnCommand(null, svnRepoFixture.getExternalRepoUrl()));
String folder = this.svnMaterial.getFolder() == null ? "external" : this.svnMaterial.getFolder() + "/" + "external";
svnMaterialForExternal.setFolder(folder);
MaterialRevision svnExternalRevision = new MaterialRevision(svnMaterialForExternal, ModificationsMother.oneModifiedFile(svnRepoFixture.getHeadRevision(svnRepoFixture.getExternalRepoUrl())));
MaterialRevision hgRevision = new MaterialRevision(hgMaterial, ModificationsMother.oneModifiedFile(hgTestRepo.latestModifications().get(0).getRevision()));
MaterialRevision dependencyRevision1 = ModificationsMother.dependencyMaterialRevision(0, dependencyMaterial.getPipelineName() + "-label", 1, dependencyMaterial, new Date());
MaterialRevision dependencyRevisionWithName = ModificationsMother.dependencyMaterialRevision(0, dependencyMaterialWithName.getPipelineName() + "-label", 1, dependencyMaterialWithName, new Date());
return new MaterialRevisions(svnRevision, svnExternalRevision, hgRevision, dependencyRevision1, dependencyRevisionWithName);
}
Aggregations