use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class PipelineWithTwoStages method addToSetup.
public void addToSetup() throws Exception {
TestRepo svnTestRepo = new SvnTestRepo(tempDir);
svnClient = new SvnCommand(null, svnTestRepo.projectRepositoryUrl());
MaterialConfigs materialConfigs = MaterialConfigsMother.mockMaterialConfigs(svnTestRepo.projectRepositoryUrl());
SvnMaterialConfig svnMaterialConfig = (SvnMaterialConfig) materialConfigs.first();
svnMaterialConfig.setName(new CaseInsensitiveString(DEFAULT_MATERIAL));
svnMaterialConfig.setConfigAttributes(Collections.singletonMap(ScmMaterialConfig.FOLDER, "default-folder"));
configHelper.addPipelineWithGroup(groupName, pipelineName, materialConfigs, devStage, jobsOfDevStage);
configHelper.addStageToPipeline(pipelineName, ftStage, JOB_FOR_FT_STAGE);
configHelper.setPipelineLabelTemplate(pipelineName, "label-${COUNT}");
dbHelper.onSetUp();
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class MaterialUpdateServiceIntegrationTest method shouldClearServerHealthLogsForMaterialThatNoLongerExistsInCruiseConfig.
@Test
public void shouldClearServerHealthLogsForMaterialThatNoLongerExistsInCruiseConfig() throws Exception {
HealthStateScope badScope = HealthStateScope.forMaterial(new SvnMaterial("non-existent-url!", "user", "pwd", false));
serverHealthService.update(ServerHealthState.error("where's the material!", "fubar", HealthStateType.general(badScope)));
SvnMaterialConfig goodMaterial = svn("good-url!", "user", "pwd", false);
HealthStateScope goodScope = HealthStateScope.forMaterialConfig(goodMaterial);
serverHealthService.update(ServerHealthState.error("could not update!", "why", HealthStateType.general(goodScope)));
MaterialUpdateService materialUpdateService = new MaterialUpdateService(null, null, mock(MaterialUpdateCompletedTopic.class), mock(GoConfigWatchList.class), mock(GoConfigService.class), systemEnvironment, serverHealthService, null, mock(MDUPerformanceLogger.class), materialConfigConverter, null, maintenanceModeService, null, null);
materialUpdateService.onConfigChange(configWithMaterial(goodMaterial));
assertThat(serverHealthService, ServerHealthMatcher.containsState(HealthStateType.general(goodScope)));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class BuildCauseProducerServiceWithFlipModificationTest method shouldMarkModificationChangedAsTrueIfMaterialsChanged.
@Test
public void shouldMarkModificationChangedAsTrueIfMaterialsChanged() throws Exception {
SvnMaterialConfig svnMaterialConfig = setUpPipelineWithTwoMaterials();
scheduleHelper.autoSchedulePipelinesWithRealMaterials(PIPELINE_NAME);
consume(buildCauseForPipeline());
configHelper.replaceMaterialForPipeline(PIPELINE_NAME, svnMaterialConfig);
scheduleHelper.autoSchedulePipelinesWithRealMaterials(PIPELINE_NAME);
verifyBuildCauseHasModificationsWith(pipelineScheduleQueue.toBeScheduled(), true);
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class MaterialExpansionServiceCachingTest method shouldExpandSvnMaterialWithExternalsIntoMultipleSvnMaterialsWhenExpandingForScheduling.
@Test
public void shouldExpandSvnMaterialWithExternalsIntoMultipleSvnMaterialsWhenExpandingForScheduling() {
SvnMaterialConfig svnMaterialConfig = svnMaterialConfig(svnRepo.projectRepositoryUrl(), "mainRepo");
MaterialConfigs materialConfigs = new MaterialConfigs();
materialExpansionService.expandForScheduling(svnMaterialConfig, materialConfigs);
assertThat(materialConfigs.size(), is(2));
assertThat(materialConfigs.get(0), is(svnMaterialConfig));
assertThat(((SvnMaterialConfig) materialConfigs.get(1)).getUrl(), endsWith("end2end/"));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class ScheduledPipelineLoaderIntegrationTest method shouldSetPasswordForExpandedSvnMaterial.
// if other materials have expansion concept at some point, add more tests here
@Test
public void shouldSetPasswordForExpandedSvnMaterial() {
JobConfig jobConfig = new JobConfig("job-one");
jobConfig.addTask(new AntTask());
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("last", new StageConfig(new CaseInsensitiveString("stage"), new JobConfigs(jobConfig)));
pipelineConfig.materialConfigs().clear();
SvnMaterialConfig materialConfig = svnRepo.materialConfig();
materialConfig.setConfigAttributes(Collections.singletonMap(SvnMaterialConfig.CHECK_EXTERNALS, String.valueOf(true)));
materialConfig.setPassword("boozer");
pipelineConfig.addMaterialConfig(materialConfig);
configHelper.addPipeline(pipelineConfig);
Pipeline loadedPipeline = createAndLoadModifyOneFilePipeline(pipelineConfig);
MaterialRevisions revisions = loadedPipeline.getBuildCause().getMaterialRevisions();
assertThat(revisions.getRevisions().size(), is(2));
assertThat(((SvnMaterial) revisions.getRevisions().get(0).getMaterial()).getPassword(), is("boozer"));
assertThat(((SvnMaterial) revisions.getRevisions().get(1).getMaterial()).getPassword(), is("boozer"));
}
Aggregations