use of com.thoughtworks.go.fixture.PipelineWithTwoStages in project gocd by gocd.
the class RestfulServiceTest method setUp.
@Before
public void setUp() throws Exception {
fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate, temporaryFolder);
configHelper = new GoConfigFileHelper().usingCruiseConfigDao(cruiseConfigDao);
configHelper.onSetUp();
dbHelper.onSetUp();
fixture.usingThreeJobs();
fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
}
use of com.thoughtworks.go.fixture.PipelineWithTwoStages in project gocd by gocd.
the class ScheduleServiceCachedIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
preCondition = new PipelineWithTwoStages(materialRepository, transactionTemplate, temporaryFolder);
configHelper.usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
dbHelper.onSetUp();
preCondition.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
}
use of com.thoughtworks.go.fixture.PipelineWithTwoStages in project gocd by gocd.
the class ScheduleServiceIntegrationTest method setup.
@Before
public void setup() throws Exception {
configHelper = new GoConfigFileHelper();
dbHelper.onSetUp();
configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
configHelper.onSetUp();
pipelineFixture = new PipelineWithTwoStages(materialRepository, transactionTemplate, temporaryFolder);
pipelineFixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
mingleConfig = configHelper.addPipeline("mingle", STAGE_NAME, repository, JOB_NAME, "functional");
goConfigService.forceNotifyListeners();
agentAssignment.clear();
goCache.clear();
}
use of com.thoughtworks.go.fixture.PipelineWithTwoStages in project gocd by gocd.
the class BuildAssignmentServiceIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
configCache = new ConfigCache();
registry = ConfigElementImplementationRegistryMother.withNoPlugins();
configHelper = new GoConfigFileHelper().usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
dbHelper.onSetUp();
fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate, temporaryFolder);
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();
notifier.disableUpdates();
}
use of com.thoughtworks.go.fixture.PipelineWithTwoStages in project gocd by gocd.
the class BuildAssignmentServiceIntegrationTest method shouldCancelBuildsForDeletedJobsWhenPipelineConfigChanges.
@Test
public void shouldCancelBuildsForDeletedJobsWhenPipelineConfigChanges() throws Exception {
buildAssignmentService.initialize();
fixture = new PipelineWithTwoStages(materialRepository, transactionTemplate, temporaryFolder).usingTwoJobs();
fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
fixture.createPipelineWithFirstStageScheduled();
buildAssignmentService.onTimer();
PipelineConfig pipelineConfig = new Cloner().deepClone(configHelper.getCachedGoConfig().currentConfig().getPipelineConfigByName(new CaseInsensitiveString(fixture.pipelineName)));
String xml = new MagicalGoConfigXmlWriter(configCache, registry).toXmlPartial(pipelineConfig);
String md5 = CachedDigestUtils.md5Hex(xml);
StageConfig devStage = pipelineConfig.findBy(new CaseInsensitiveString(fixture.devStage));
devStage.getJobs().remove(devStage.jobConfigByConfigName(new CaseInsensitiveString(fixture.JOB_FOR_DEV_STAGE)));
pipelineConfigService.updatePipelineConfig(loserUser, pipelineConfig, md5, new HttpLocalizedOperationResult());
Pipeline pipeline = pipelineDao.mostRecentPipeline(fixture.pipelineName);
JobInstance deletedJob = pipeline.getFirstStage().getJobInstances().getByName(fixture.JOB_FOR_DEV_STAGE);
assertThat(deletedJob.getState(), is(JobState.Completed));
assertThat(deletedJob.getResult(), is(JobResult.Cancelled));
JobInstance retainedJob = pipeline.getFirstStage().getJobInstances().getByName(fixture.DEV_STAGE_SECOND_JOB);
assertThat(retainedJob.getState(), is(JobState.Scheduled));
assertThat(retainedJob.getResult(), is(JobResult.Unknown));
}
Aggregations