Search in sources :

Example 51 with PipelineConfig

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"));
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) Test(org.junit.Test)

Example 52 with PipelineConfig

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)));
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) MagicalGoConfigXmlWriter(com.thoughtworks.go.config.MagicalGoConfigXmlWriter) Test(org.junit.Test)

Example 53 with PipelineConfig

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();
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) PipelineWithTwoStages(com.thoughtworks.go.fixture.PipelineWithTwoStages) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper)

Example 54 with PipelineConfig

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);
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig)

Example 55 with PipelineConfig

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();
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) TimeProvider(com.thoughtworks.go.util.TimeProvider) Before(org.junit.Before)

Aggregations

PipelineConfig (com.thoughtworks.go.config.PipelineConfig)186 Test (org.junit.Test)129 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)76 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)32 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)19 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)17 TimeProvider (com.thoughtworks.go.util.TimeProvider)16 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)15 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)13 Pipeline (com.thoughtworks.go.domain.Pipeline)13 MaterialConfig (com.thoughtworks.go.domain.materials.MaterialConfig)13 Date (java.util.Date)13 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)12 PipelineConfigDependencyGraph (com.thoughtworks.go.server.domain.PipelineConfigDependencyGraph)12 StageConfig (com.thoughtworks.go.config.StageConfig)11 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)11 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)11 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)11 PipelineConfigs (com.thoughtworks.go.config.PipelineConfigs)9 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)9