use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class EntityHashingServiceTest method shouldInvalidatePipelineConfigEtagsFromCacheOnPipelineChange.
@Test
public void shouldInvalidatePipelineConfigEtagsFromCacheOnPipelineChange() {
EntityHashingService.PipelineConfigChangedListener listener = entityHashingService.new PipelineConfigChangedListener();
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("P1");
listener.onEntityConfigChange(pipelineConfig);
verify(goCache).remove("GO_ETAG_CACHE", (pipelineConfig.getClass().getName() + "." + "p1"));
}
use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class EntityHashingServiceTest method shouldComputeTheMD5OfAGivenXmlPartialGeneratedFromAnObject.
@Test
public void shouldComputeTheMD5OfAGivenXmlPartialGeneratedFromAnObject() {
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("P1");
String xml = new MagicalGoConfigXmlWriter(configCache, registry).toXmlPartial(pipelineConfig);
assertThat(entityHashingService.md5ForEntity(pipelineConfig), is(CachedDigestUtils.md5Hex(xml)));
}
use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class JobInstanceStatusMonitorTest method setUp.
@Before
public void setUp() throws Exception {
configHelper = new GoConfigFileHelper().usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
dbHelper.onSetUp();
fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate, temporaryFolder);
fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
PipelineConfig evolveConfig = configHelper.addPipeline("evolve", STAGE_NAME, repository, "unit");
configHelper.addPipeline("anotherPipeline", STAGE_NAME, repository, "anotherTest");
configHelper.addPipeline("thirdPipeline", STAGE_NAME, repository, "yetAnotherTest");
goConfigService.forceNotifyListeners();
goCache.clear();
agent = new AgentStub();
}
use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class DatabaseAccessHelper method saveTestPipelineWithoutSchedulingBuilds.
public Pipeline saveTestPipelineWithoutSchedulingBuilds(String pipelineName, String stageName, String... jobConfigNames) throws SQLException {
PipelineConfig pipelineConfig = configurePipeline(pipelineName, stageName, jobConfigNames);
Pipeline pipeline = scheduleWithFileChanges(pipelineConfig);
clearAllBuildInstances(pipeline);
return savePipelineWithStagesAndMaterials(pipeline);
}
use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class JobAgentMetadataSqlMapDaoIntegrationTest method setup.
@Before
public void setup() throws Exception {
dbHelper.onSetUp();
PipelineConfig pipelineConfig = PipelineMother.withSingleStageWithMaterials(PIPELINE_NAME, STAGE_NAME, BuildPlanMother.withBuildPlans(JOB_NAME, OTHER_JOB_NAME));
DefaultSchedulingContext schedulingContext = new DefaultSchedulingContext(DEFAULT_APPROVED_BY);
Pipeline savedPipeline = instanceFactory.createPipelineInstance(pipelineConfig, modifySomeFiles(pipelineConfig), schedulingContext, "md5-test", new TimeProvider());
dbHelper.savePipelineWithStagesAndMaterials(savedPipeline);
Stage savedStage = savedPipeline.getFirstStage();
jobId = savedStage.getJobInstances().getByName(JOB_NAME).getId();
}
Aggregations