Search in sources :

Example 46 with GoConfigFileHelper

use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.

the class PipelineSqlMapDaoIntegrationTest method setup.

@BeforeEach
public void setup() throws Exception {
    dbHelper.onSetUp();
    goCache.clear();
    configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(goConfigDao);
    u = new ScheduleTestUtil(transactionTemplate, materialRepository, dbHelper, configHelper);
    notifier.disableUpdates();
}
Also used : GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) ScheduleTestUtil(com.thoughtworks.go.server.service.ScheduleTestUtil) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 47 with GoConfigFileHelper

use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.

the class BuildCauseProducerServiceWithFlipModificationTest method setup.

@BeforeEach
public void setup(@TempDir Path tempDir) throws Exception {
    configHelper = new GoConfigFileHelper();
    dbHelper.onSetUp();
    configHelper.usingCruiseConfigDao(goConfigDao);
    configHelper.onSetUp();
    svnRepository = new SvnTestRepo(tempDir);
    hgTestRepo = new HgTestRepo("testHgRepo", tempDir);
    repository = new SvnCommand(null, svnRepository.projectRepositoryUrl());
    svnMaterialConfig = svn(repository.getUrl().originalArgument(), repository.getUserName(), repository.getPassword(), repository.isCheckExternals());
}
Also used : SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) HgTestRepo(com.thoughtworks.go.helper.HgTestRepo) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 48 with GoConfigFileHelper

use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.

the class ChangeMaterialsTest method setUp.

@BeforeEach
public void setUp(@TempDir Path tempDir) throws Exception {
    username = new Username(new CaseInsensitiveString("gli"));
    dbHelper.onSetUp();
    cruiseConfig = new GoConfigFileHelper().usingCruiseConfigDao(goConfigDao);
    cruiseConfig.onSetUp();
    hgTestRepo = new HgTestRepo(tempDir);
    SvnTestRepo svnRepo = new SvnTestRepo(tempDir);
    cruiseConfig.addPipeline(PIPELINE_NAME, DEV_STAGE, svnRepo.materialConfig(), "foo");
    mingle = cruiseConfig.addStageToPipeline(PIPELINE_NAME, FT_STAGE, "bar");
    pipeline = dbHelper.newPipelineWithAllStagesPassed(mingle);
    listener = new StubScheduleCheckCompletedListener();
    topic.addListener(listener);
}
Also used : StubScheduleCheckCompletedListener(com.thoughtworks.go.server.messaging.StubScheduleCheckCompletedListener) Username(com.thoughtworks.go.server.domain.Username) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) HgTestRepo(com.thoughtworks.go.helper.HgTestRepo) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Example 49 with GoConfigFileHelper

use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.

the class AutoSchedulerIntegrationTest method setUp.

@BeforeEach
public void setUp(@TempDir Path tempDir) throws Exception {
    GoConfigFileHelper configFileHelper = new GoConfigFileHelper().usingCruiseConfigDao(goConfigDao);
    dbHelper.onSetUp();
    configFileHelper.onSetUp();
    configFileHelper.usingCruiseConfigDao(goConfigDao);
    configWithFreeEditionLicense = new ConfigWithFreeEditionLicense(configFileHelper);
    configWithFreeEditionLicense.onSetUp();
    configService.forceNotifyListeners();
    twoPipelineGroups = new TwoPipelineGroups(configFileHelper, tempDir);
    twoPipelineGroups.onSetUp();
    serverHealthService.removeAllLogs();
}
Also used : TwoPipelineGroups(com.thoughtworks.go.fixture.TwoPipelineGroups) ConfigWithFreeEditionLicense(com.thoughtworks.go.fixture.ConfigWithFreeEditionLicense) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 50 with GoConfigFileHelper

use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.

the class PipelineScheduleServiceTest method setup.

@BeforeEach
public void setup(@TempDir Path tempDir) throws Exception {
    configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(goConfigDao);
    configHelper.onSetUp();
    testRepo = new SvnTestRepo(tempDir);
    dbHelper.onSetUp();
    repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
    mingleConfig = configHelper.addPipeline("mingle", STAGE_NAME, repository, "unit", "functional");
    goConfig = configHelper.addPipeline("go", STAGE_NAME, repository, "unit");
    StageConfig ftStageConfig = StageConfigMother.custom("ft", "twist");
    ftStageConfig.jobConfigByConfigName(new CaseInsensitiveString("twist")).addVariable("JOB_LVL", "job value");
    ftStageConfig.setVariables(env("STAGE_LVL", "stage value"));
    configHelper.addStageToPipeline("go", ftStageConfig);
    configHelper.addEnvironmentVariableToPipeline("go", env("PIPELINE_LVL", "pipeline value"));
    configHelper.addEnvironments("uat");
    EnvironmentConfig uatEnv = configHelper.currentConfig().getEnvironments().named(new CaseInsensitiveString("uat"));
    uatEnv.addPipeline(new CaseInsensitiveString("go"));
    uatEnv.addEnvironmentVariable("ENV_LVL", "env value");
    evolveConfig = configHelper.addPipeline("evolve", STAGE_NAME, repository, "unit");
    goCache.clear();
}
Also used : SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

GoConfigFileHelper (com.thoughtworks.go.util.GoConfigFileHelper)64 BeforeEach (org.junit.jupiter.api.BeforeEach)36 Before (org.junit.Before)23 PipelineWithTwoStages (com.thoughtworks.go.fixture.PipelineWithTwoStages)16 SvnCommand (com.thoughtworks.go.domain.materials.svn.SvnCommand)8 Username (com.thoughtworks.go.server.domain.Username)6 SvnTestRepo (com.thoughtworks.go.helper.SvnTestRepo)5 File (java.io.File)5 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)5 HgTestRepo (com.thoughtworks.go.helper.HgTestRepo)4 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)4 PipelineWithMultipleStages (com.thoughtworks.go.fixture.PipelineWithMultipleStages)3 TriStateSelection (com.thoughtworks.go.presentation.TriStateSelection)3 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)2 ConfigRepoConfig (com.thoughtworks.go.config.remote.ConfigRepoConfig)2 ConfigWithFreeEditionLicense (com.thoughtworks.go.fixture.ConfigWithFreeEditionLicense)2 TwoPipelineGroups (com.thoughtworks.go.fixture.TwoPipelineGroups)2 StubScheduleCheckCompletedListener (com.thoughtworks.go.server.messaging.StubScheduleCheckCompletedListener)2 ScheduleTestUtil (com.thoughtworks.go.server.service.ScheduleTestUtil)2 ConfigRepository (com.thoughtworks.go.service.ConfigRepository)2