Search in sources :

Example 21 with GoConfigFileHelper

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

the class PipelineConfigServiceIntegrationTest 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"));
    pipelineConfig = GoConfigMother.createPipelineConfigWithMaterialConfig(UUID.randomUUID().toString(), new GitMaterialConfig("FOO"));
    goConfigService.addPipeline(pipelineConfig, groupName);
    repoConfig1 = new ConfigRepoConfig(MaterialConfigsMother.gitMaterialConfig("url"), XmlPartialConfigProvider.providerName);
    repoConfig2 = new ConfigRepoConfig(MaterialConfigsMother.gitMaterialConfig("url2"), XmlPartialConfigProvider.providerName);
    goConfigService.updateConfig(new UpdateConfigCommand() {

        @Override
        public CruiseConfig update(CruiseConfig cruiseConfig) throws Exception {
            cruiseConfig.getConfigRepos().add(repoConfig1);
            cruiseConfig.getConfigRepos().add(repoConfig2);
            return cruiseConfig;
        }
    });
    GoCipher goCipher = new GoCipher();
    goConfigService.updateServerConfig(new MailHost(goCipher), new LdapConfig(goCipher), new PasswordFileConfig("path"), false, goConfigService.configFileMd5(), "artifacts", null, null, "0", null, null, "foo");
    UpdateConfigCommand command = goConfigService.modifyAdminPrivilegesCommand(asList(user.getUsername().toString()), new TriStateSelection(Admin.GO_SYSTEM_ADMIN, TriStateSelection.Action.add));
    goConfigService.updateConfig(command);
    remoteDownstreamPipelineName = "remote-downstream";
    partialConfig = PartialConfigMother.pipelineWithDependencyMaterial(remoteDownstreamPipelineName, pipelineConfig, new RepoConfigOrigin(repoConfig1, "repo1_r1"));
    goPartialConfig.onSuccessPartialConfig(repoConfig1, partialConfig);
    PartialConfig partialConfigFromRepo2 = PartialConfigMother.withPipeline("independent-pipeline", new RepoConfigOrigin(repoConfig2, "repo2_r1"));
    goPartialConfig.onSuccessPartialConfig(repoConfig2, partialConfigFromRepo2);
    result = new HttpLocalizedOperationResult();
    headCommitBeforeUpdate = configRepository.getCurrentRevCommit().name();
}
Also used : GoCipher(com.thoughtworks.go.security.GoCipher) ConfigRepoConfig(com.thoughtworks.go.config.remote.ConfigRepoConfig) TriStateSelection(com.thoughtworks.go.presentation.TriStateSelection) PartialConfig(com.thoughtworks.go.config.remote.PartialConfig) ExpectedException(org.junit.rules.ExpectedException) GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) HttpLocalizedOperationResult(com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult) Username(com.thoughtworks.go.server.domain.Username) GitMaterialConfig(com.thoughtworks.go.config.materials.git.GitMaterialConfig) RepoConfigOrigin(com.thoughtworks.go.config.remote.RepoConfigOrigin) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper)

Example 22 with GoConfigFileHelper

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

the class GoPropertiesTestTest method setUp.

@Before
public void setUp() throws Exception {
    configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(cruiseConfigDao);
    configHelper.onSetUp();
    fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate);
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    configHelper.addAgent(HOSTNAME, AGENT_UUID);
}
Also used : PipelineWithTwoStages(com.thoughtworks.go.fixture.PipelineWithTwoStages) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) Before(org.junit.Before)

Example 23 with GoConfigFileHelper

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

the class GoConfigServiceIntegrationTest method setup.

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

Example 24 with GoConfigFileHelper

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

the class ArtifactsDirChangeTest method setUp.

@Before
public void setUp() throws Exception {
    configHelper = new GoConfigFileHelper().usingCruiseConfigDao(configDao);
    fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate);
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    serverHealthService.removeAllLogs();
}
Also used : PipelineWithTwoStages(com.thoughtworks.go.fixture.PipelineWithTwoStages) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) Before(org.junit.Before)

Example 25 with GoConfigFileHelper

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

the class LdapAuthenticationProviderTest method setUp.

@Before
public void setUp() throws Exception {
    configFileHelper = new GoConfigFileHelper();
    configFileHelper.usingCruiseConfigDao(goConfigDao);
    configFileHelper.initializeConfigFile();
}
Also used : GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) 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