Search in sources :

Example 11 with GoConfigFileHelper

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

the class PropertiesControllerTest method setUp.

@Before
public void setUp() throws Exception {
    configHelper = new GoConfigFileHelper();
    fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate);
    fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
    controller = new PropertiesController(propertiesService, restfulService, pipelineService, systemEnvironment);
    response = new MockHttpServletResponse();
}
Also used : PipelineWithTwoStages(com.thoughtworks.go.fixture.PipelineWithTwoStages) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) Before(org.junit.Before)

Example 12 with GoConfigFileHelper

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

the class ArtifactsControllerIntegrationTest method setup.

@Before
public void setup() throws Exception {
    configHelper = new GoConfigFileHelper();
    configHelper.onSetUp();
    configHelper.usingCruiseConfigDao(goConfigDao);
    pipelineName = "pipeline-" + UUID.randomUUID().toString();
    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    dbHelper.onSetUp();
    pipeline = dbHelper.saveTestPipeline(pipelineName, "stage", "build");
    dbHelper.saveBuildingStage(pipeline.getStages().byName("stage"));
    configHelper.addPipeline(pipelineName, "stage", "build");
    stage = pipeline.getStages().byName("stage");
    job = stage.getJobInstances().getByName("build");
    buildId = job.getId();
    JobIdentifier jobId = new JobIdentifier(pipeline.getName(), -2, pipeline.getLabel(), stage.getName(), String.valueOf(stage.getCounter()), job.getName(), job.getId());
    artifactsRoot = artifactService.findArtifact(jobId, "");
    consoleLogFile = consoleService.consoleLogFile(jobId);
    deleteDirectory(consoleLogFile.getParentFile());
    deleteDirectory(artifactsRoot);
    artifactsRoot.mkdirs();
}
Also used : MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) Before(org.junit.Before)

Example 13 with GoConfigFileHelper

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

the class BuildCauseProducerServiceWithFlipModificationTest method setup.

@Before
public void setup() throws Exception {
    configHelper = new GoConfigFileHelper();
    dbHelper.onSetUp();
    configHelper.onSetUp();
    configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
    svnRepository = new SvnTestRepo("testSvnRepo");
    hgTestRepo = new HgTestRepo("testHgRepo");
    repository = new SvnCommand(null, svnRepository.projectRepositoryUrl());
    svnMaterialConfig = new SvnMaterialConfig(repository.getUrl().forCommandline(), 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) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) Before(org.junit.Before)

Example 14 with GoConfigFileHelper

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

the class ChangeMaterialsTest method setUp.

@Before
public void setUp() throws Exception {
    username = new Username(new CaseInsensitiveString("gli"));
    dbHelper.onSetUp();
    cruiseConfig = new GoConfigFileHelper().usingCruiseConfigDao(goConfigDao);
    cruiseConfig.onSetUp();
    cruiseConfig.initializeConfigFile();
    hgTestRepo = new HgTestRepo();
    SvnTestRepo svnRepo = new SvnTestRepo();
    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) Before(org.junit.Before)

Example 15 with GoConfigFileHelper

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

the class LdapAuthenticationTest method setUp.

@Before
public void setUp() throws Exception {
    configFileHelper = new GoConfigFileHelper();
    configFileHelper.usingCruiseConfigDao(goConfigDao);
    configFileHelper.initializeConfigFile();
    configFileHelper.addLdapSecurity(LDAP_URL, MANAGER_DN, MANAGER_PASSWORD, SEARCH_BASE, SEARCH_FILTER);
    ldapServer = new InMemoryLdapServerForTests(BASE_DN, MANAGER_DN, MANAGER_PASSWORD).start(PORT);
    ldapServer.addOrganizationalUnit("Principal", "ou=Principal," + BASE_DN);
    ldapServer.addOrganizationalUnit("Company", "ou=Company,ou=Principal," + BASE_DN);
    employeesOrgUnit = ldapServer.addOrganizationalUnit("Employees", "ou=Employees,ou=Company,ou=Principal," + BASE_DN);
}
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