Search in sources :

Example 16 with GoConfigFileHelper

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

the class AgentConfigServiceIntegrationTest method setup.

@Before
public void setup() throws Exception {
    agentInstances = new AgentInstances(new AgentRuntimeStatus.ChangeListener() {

        @Override
        public void statusUpdateRequested(AgentRuntimeInfo runtimeInfo, AgentRuntimeStatus newStatus) {
        }
    });
    configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
    configHelper.onSetUp();
    goConfigService.forceNotifyListeners();
}
Also used : AgentInstances(com.thoughtworks.go.server.domain.AgentInstances) AgentRuntimeStatus(com.thoughtworks.go.domain.AgentRuntimeStatus) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) Before(org.junit.Before)

Example 17 with GoConfigFileHelper

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

the class MingleConfigServiceIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    dbHelper.onSetUp();
    configHelper = new GoConfigFileHelper(goConfigDao);
    configHelper.onSetUp();
    configHelper.addPipeline("bar", "stage", MaterialConfigsMother.defaultMaterialConfigs(), "build");
    pipelineConfig = configHelper.addPipeline("foo", "stage", MaterialConfigsMother.defaultMaterialConfigs(), "build");
    configHelper.addMingleConfigToPipeline("foo", new MingleConfig("https://some-tracking-tool:8443", "project-super-secret", "hello=world"));
    CruiseConfig cruiseConfig = configHelper.load();
    PipelineConfigs group = cruiseConfig.findGroup("defaultGroup");
    group.setAuthorization(new Authorization(new ViewConfig(new AdminUser(new CaseInsensitiveString("authorized_user")))));
    configHelper.writeConfigFile(cruiseConfig);
    SecurityConfig securityConfig = new SecurityConfig(new LdapConfig(new GoCipher()), new PasswordFileConfig("/tmp/foo.passwd"), true);
    securityConfig.adminsConfig().add(new AdminUser(new CaseInsensitiveString("admin")));
    configHelper.addSecurity(securityConfig);
}
Also used : Authorization(com.thoughtworks.go.config.Authorization) LdapConfig(com.thoughtworks.go.config.LdapConfig) GoCipher(com.thoughtworks.go.security.GoCipher) SecurityConfig(com.thoughtworks.go.config.SecurityConfig) ViewConfig(com.thoughtworks.go.config.ViewConfig) AdminUser(com.thoughtworks.go.config.AdminUser) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) MingleConfig(com.thoughtworks.go.config.MingleConfig) PasswordFileConfig(com.thoughtworks.go.config.PasswordFileConfig) CruiseConfig(com.thoughtworks.go.config.CruiseConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Before(org.junit.Before)

Example 18 with GoConfigFileHelper

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

the class StageControllerIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    fixture = new PipelineWithMultipleStages(3, materialRepository, transactionTemplate);
    this.configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(goConfigDao);
    configHelper.onSetUp();
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    request.addHeader("Confirm", "true");
}
Also used : MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) PipelineWithMultipleStages(com.thoughtworks.go.fixture.PipelineWithMultipleStages) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) Before(org.junit.Before)

Example 19 with GoConfigFileHelper

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

the class TimeReportingTest 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 20 with GoConfigFileHelper

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

the class LdapConfigChangedListenerTest method setUp.

@Before
public void setUp() throws IOException {
    helper = new GoConfigFileHelper();
    helper.onSetUp();
}
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