Search in sources :

Example 6 with GoConfigFileHelper

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

the class ValueStreamMapPerformanceTest method setup.

@Before
public void setup() throws Exception {
    configHelper = new GoConfigFileHelper();
    dbHelper.onSetUp();
    configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
    configHelper.onSetUp();
    goConfigService.forceNotifyListeners();
    u = new ScheduleTestUtil(transactionTemplate, materialRepository, dbHelper, configHelper);
    graphGenerator = new GraphGenerator(configHelper, u);
}
Also used : GraphGenerator(com.thoughtworks.go.helpers.GraphGenerator) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) Before(org.junit.Before)

Example 7 with GoConfigFileHelper

use of com.thoughtworks.go.util.GoConfigFileHelper 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);
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
    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();
    u = new ScheduleTestUtil(transactionTemplate, materialRepository, dbHelper, configHelper);
    agent = new AgentStub();
}
Also used : PipelineWithTwoStages(com.thoughtworks.go.fixture.PipelineWithTwoStages) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper)

Example 8 with GoConfigFileHelper

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

the class PackageDefinitionServiceIntegrationTest method setup.

@Before
public void setup() throws Exception {
    cachedGoPartials.clear();
    configHelper = new GoConfigFileHelper();
    dbHelper.onSetUp();
    configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
    configHelper.onSetUp();
    goConfigService.forceNotifyListeners();
    user = new Username(new CaseInsensitiveString("current"));
    final PackageRepository npmRepo = new PackageRepository();
    PluginConfiguration pluginConfiguration = new PluginConfiguration();
    pluginConfiguration.setId("npm");
    pluginConfiguration.setVersion("1");
    npmRepo.setPluginConfiguration(pluginConfiguration);
    repoId = "repoId";
    npmRepo.setId(repoId);
    npmRepo.setName(repoId);
    Configuration configuration = new Configuration();
    configuration.add(new ConfigurationProperty(new ConfigurationKey("PACKAGE_ID"), new ConfigurationValue("prettyjson")));
    npmRepo.setConfiguration(configuration);
    goConfigService.updateConfig(new UpdateConfigCommand() {

        @Override
        public CruiseConfig update(CruiseConfig cruiseConfig) throws Exception {
            cruiseConfig.setPackageRepositories(new PackageRepositories(npmRepo));
            return cruiseConfig;
        }
    });
    UpdateConfigCommand command = goConfigService.modifyAdminPrivilegesCommand(asList(user.getUsername().toString()), new TriStateSelection(Admin.GO_SYSTEM_ADMIN, TriStateSelection.Action.add));
    goConfigService.updateConfig(command);
}
Also used : ContextConfiguration(org.springframework.test.context.ContextConfiguration) PackageRepositories(com.thoughtworks.go.domain.packagerepository.PackageRepositories) PackageRepository(com.thoughtworks.go.domain.packagerepository.PackageRepository) TriStateSelection(com.thoughtworks.go.presentation.TriStateSelection) Username(com.thoughtworks.go.server.domain.Username) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) Before(org.junit.Before)

Example 9 with GoConfigFileHelper

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

the class AutoSchedulerIntegrationTest method setUp.

@Before
public void setUp() 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);
    twoPipelineGroups.onSetUp();
    serverHealthService.removeAllLogs();
}
Also used : TwoPipelineGroups(com.thoughtworks.go.fixture.TwoPipelineGroups) ConfigWithFreeEditionLicense(com.thoughtworks.go.fixture.ConfigWithFreeEditionLicense) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) Before(org.junit.Before)

Example 10 with GoConfigFileHelper

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

the class JobControllerIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(goConfigDao);
    fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate);
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    controller = new JobController(jobInstanceService, jobDetailService, goConfigService, pipelineService, restfulService, artifactService, propertiesService, stageService, localizer);
}
Also used : PipelineWithTwoStages(com.thoughtworks.go.fixture.PipelineWithTwoStages) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) Before(org.junit.Before)

Aggregations

GoConfigFileHelper (com.thoughtworks.go.util.GoConfigFileHelper)35 Before (org.junit.Before)31 PipelineWithTwoStages (com.thoughtworks.go.fixture.PipelineWithTwoStages)10 SvnCommand (com.thoughtworks.go.domain.materials.svn.SvnCommand)5 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)4 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)3 SvnTestRepo (com.thoughtworks.go.helper.SvnTestRepo)3 Username (com.thoughtworks.go.server.domain.Username)3 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)3 PipelineWithMultipleStages (com.thoughtworks.go.fixture.PipelineWithMultipleStages)2 HgTestRepo (com.thoughtworks.go.helper.HgTestRepo)2 TriStateSelection (com.thoughtworks.go.presentation.TriStateSelection)2 GoCipher (com.thoughtworks.go.security.GoCipher)2 AdminUser (com.thoughtworks.go.config.AdminUser)1 Authorization (com.thoughtworks.go.config.Authorization)1 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)1 EnvironmentConfig (com.thoughtworks.go.config.EnvironmentConfig)1 LdapConfig (com.thoughtworks.go.config.LdapConfig)1 MingleConfig (com.thoughtworks.go.config.MingleConfig)1 PasswordFileConfig (com.thoughtworks.go.config.PasswordFileConfig)1