Search in sources :

Example 41 with GoConfigFileHelper

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

the class InvalidConfigMessageRemoverIntegrationTest method setUp.

@BeforeEach
public void setUp(@TempDir File tempFolder) throws Exception {
    configFile = new File(tempFolder, "cruise-config.xml");
    configFile.createNewFile();
    GoConfigFileHelper.clearConfigVersions();
    configHelper = new GoConfigFileHelper();
    configHelper.onSetUp();
    SystemEnvironment systemEnvironment = new SystemEnvironment();
    systemEnvironment.setProperty(SystemEnvironment.CONFIG_FILE_PROPERTY, configFile.getAbsolutePath());
    new ConfigRepository(systemEnvironment).initialize();
    serverHealthService.removeAllLogs();
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) ConfigRepository(com.thoughtworks.go.service.ConfigRepository) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) File(java.io.File) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 42 with GoConfigFileHelper

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

the class AgentAssignmentTest method setUp.

@BeforeEach
public void setUp(@TempDir Path tempDir) throws Exception {
    configHelper = new GoConfigFileHelper();
    fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate, tempDir);
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    agentAssignment.clear();
}
Also used : PipelineWithTwoStages(com.thoughtworks.go.fixture.PipelineWithTwoStages) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 43 with GoConfigFileHelper

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

the class JobControllerIntegrationTest method setUp.

@BeforeEach
public void setUp(@TempDir Path tempDir) throws Exception {
    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    configHelper = new GoConfigFileHelper();
    configHelper.usingCruiseConfigDao(goConfigDao);
    fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate, tempDir);
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    controller = new JobController(jobInstanceService, agentService, jobInstanceDao, goConfigService, pipelineService, restfulService, artifactService, stageService, jobAgentMetadataDao, systemEnvironment, securityService);
}
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) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 44 with GoConfigFileHelper

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

the class PipelineStateDaoIntegrationTest method setup.

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

Example 45 with GoConfigFileHelper

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

the class GoDashboardCurrentStateLoaderIntegrationTest method setUp.

@BeforeEach
public void setUp(@TempDir File configDir) throws Exception {
    dbHelper.onSetUp();
    String absolutePath = new File(configDir, "cruise-config.xml").getAbsolutePath();
    systemEnvironment.setProperty(SystemEnvironment.CONFIG_FILE_PROPERTY, absolutePath);
    configHelper = new GoConfigFileHelper(DEFAULT_XML_WITH_2_AGENTS);
    configHelper.usingCruiseConfigDao(goConfigDao);
    configHelper.onSetUp();
    goConfigService.forceNotifyListeners();
    goDashboardCurrentStateLoader.reset();
}
Also used : GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) File(java.io.File) 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