use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class StageIntegrationTest method createPipelineWithFirstStageBuilding.
private Pipeline createPipelineWithFirstStageBuilding() throws StageAlreadyBuildingException {
Pipeline scheduledPipeline = schedulePipeline();
dbHelper.saveBuildingStage(scheduledPipeline.getFirstStage());
return pipelineDao.mostRecentPipeline(CaseInsensitiveString.str(mingle.name()));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class StageCctrayPresentationModelTest method setUp.
@Before
public void setUp() throws Exception {
Stage stage = StageMother.passedStageInstance("cruise", "ft", "firefox", DATE);
stage.setId(STAGE_ID);
stage.setCompletedByTransitionId(100L);
stage.getJobInstances().getByName("firefox").setId(BUILD_ID);
Pipeline pipeline = PipelineMother.pipeline("cruise", stage);
// used to mock pipeline label
pipeline.setId(ID);
// used to mock pipeline label
pipeline.setLabel(LABEL);
cctrayXmlPresenter = new StageCctrayPresentationModel(pipeline, stage);
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class BackgroundStageLoaderIntegrationTest method handleAStageURLNotYetSeenShouldStoreStageResourceIntoStageStorage.
@Test
public void handleAStageURLNotYetSeenShouldStoreStageResourceIntoStageStorage() {
TestFailureSetup.SavedStage savedStage = failureSetup.setupPipelineInstanceWithoutTestXmlStubbing(true, null, new Date());
loader.handle(feedEntry(savedStage), pipelineInstanceLoader);
assertTrue(stageStorage.isStageStored(savedStage.stageId));
Graph storedGraph = stageStorage.load(savedStage.stageId);
Stage stage = savedStage.stage;
String baseUrl = "https://localhost:8154/go";
String jobUrl = new JobXmlViewModel(stage.getJobInstances().first()).httpUrl(baseUrl);
assertTrue(storedGraph.containsResourceWithURI(jobUrl));
assertTrue(storedGraph.containsResourceWithURI(new StageXmlViewModel(stage).httpUrl(baseUrl)));
Pipeline pipeline = savedStage.pipeline;
assertTrue(storedGraph.containsResourceWithURI(PipelineXmlViewModel.httpUrlForPipeline(baseUrl, pipeline.getId(), pipeline.getName())));
Modification latestModification = pipeline.getMaterialRevisions().getRevisions().get(0).getLatestModification();
assertTrue(storedGraph.containsResourceWithURI(ScmMaterial.changesetUrl(latestModification, baseUrl, latestModification.getMaterialInstance().getId())));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class CachedCurrentActivityServiceIntegrationTest method testShouldReturnFalseIfAStageOfAPipelineHasNotStarted.
@Test
public void testShouldReturnFalseIfAStageOfAPipelineHasNotStarted() {
Pipeline pipeline = fixture.createPipelineWithFirstStagePassedAndSecondStageHasNotStarted();
assertThat(cachedCurrentActivityService.isAnyStageActive(pipeline.getIdentifier()), is(false));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class ScheduleServiceSecurityTest method shouldCancelStageGivenValidPipelineAndStageName.
@Test
public void shouldCancelStageGivenValidPipelineAndStageName() throws Exception {
configHelper.enableSecurity();
Username user = UserHelper.getUserName();
configHelper.setOperatePermissionForGroup("defaultGroup", user.getUsername().toString());
Pipeline pipeline = fixture.createPipelineWithFirstStagePassedAndSecondStageRunning();
HttpLocalizedOperationResult operationResult = new HttpLocalizedOperationResult();
Stage stageForCancellation = pipeline.getStages().byName(fixture.ftStage);
Stage resultStage = scheduleService.cancelAndTriggerRelevantStages(pipeline.getName(), stageForCancellation.getName(), user, operationResult);
assertThat(resultStage, is(not(nullValue())));
assertThat(operationResult.isSuccessful(), is(true));
assertThat(operationResult.httpCode(), is(SC_OK));
}
Aggregations