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() {
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("last", new StageConfig(new CaseInsensitiveString("stage"), new JobConfigs(new JobConfig("job-one"))));
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"));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method shouldCreateEmptyPipelineIfThePipelineHasNeverBeenRun.
@Test
public void shouldCreateEmptyPipelineIfThePipelineHasNeverBeenRun() throws Exception {
SvnMaterialConfig svnMaterial = new SvnMaterialConfig("https://some-url", "new-user", "new-pass", false);
configHelper.addPipeline("new-pipeline", "new-stage", svnMaterial, "first-job");
PipelineInstanceModels instanceModels = pipelineHistoryService.loadWithEmptyAsDefault("new-pipeline", Pagination.ONE_ITEM, "username");
PipelineInstanceModel instanceModel = instanceModels.get(0);
assertThat(instanceModel.getMaterials(), is(new MaterialConfigs(svnMaterial)));
assertThat(instanceModel.getCurrentRevision(svnMaterial).getRevision(), is("No historical data"));
assertThat(instanceModel.getLatestRevision(svnMaterial).getRevision(), is("No historical data"));
assertThat(instanceModel.getStageHistory().size(), is(1));
assertThat(instanceModel.getStageHistory().get(0).getName(), is("new-stage"));
}
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 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 = new SvnMaterialConfig("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);
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 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/"));
}
Aggregations