use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class ModificationBuildCauseTest method shouldGetBuildCausedByIfIsDenpendencyMaterial.
@Test
public void shouldGetBuildCausedByIfIsDenpendencyMaterial() throws Exception {
MaterialRevisions revisions = new MaterialRevisions();
Modification modification = new Modification(new Date(), "pipelineName/10/stageName/1", "MOCK_LABEL-12", null);
revisions.addRevision(new DependencyMaterial(new CaseInsensitiveString("cruise"), new CaseInsensitiveString("dev")), modification);
assertThat(BuildCause.createWithModifications(revisions, "").getBuildCauseMessage(), is("triggered by pipelineName/10/stageName/1"));
}
use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class ParamConfigTest method shouldValidateName.
@Test
public void shouldValidateName() {
ParamConfig paramConfig = new ParamConfig();
ValidationContext validationContext = mock(ValidationContext.class);
when(validationContext.getPipeline()).thenReturn(new PipelineConfig(new CaseInsensitiveString("p"), null));
paramConfig.validateName(new HashMap<>(), validationContext);
assertThat(paramConfig.errors().on(ParamConfig.NAME), is("Parameter cannot have an empty name for pipeline 'p'."));
}
use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class DependencyMaterialAgentTest method materialRevision.
private MaterialRevision materialRevision(String pipelineName, Integer pipelineCounter, String pipelineLabel, String stageName, int stageCounter) {
DependencyMaterial material = new DependencyMaterial(new CaseInsensitiveString(pipelineName), new CaseInsensitiveString(stageName));
DependencyMaterialRevision revision = DependencyMaterialRevision.create(pipelineName, pipelineCounter, pipelineLabel, stageName, stageCounter);
MaterialRevision materialRevision = revision.convert(material, new Date());
return materialRevision;
}
use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class JobController method presenter.
private JobDetailPresentationModel presenter(JobInstance current) {
String pipelineName = current.getIdentifier().getPipelineName();
String stageName = current.getIdentifier().getStageName();
JobInstances recent25 = jobInstanceService.latestCompletedJobs(pipelineName, stageName, current.getName());
AgentConfig agentConfig = goConfigService.agentByUuid(current.getAgentUuid());
Pipeline pipelineWithOneBuild = pipelineService.wrapBuildDetails(current);
Tabs customizedTabs = goConfigService.getCustomizedTabs(pipelineWithOneBuild.getName(), pipelineWithOneBuild.getFirstStage().getName(), current.getName());
TrackingTool trackingTool = goConfigService.pipelineConfigNamed(new CaseInsensitiveString(pipelineWithOneBuild.getName())).trackingTool();
Properties properties = propertiesService.getPropertiesForJob(current.getId());
Stage stage = stageService.getStageByBuild(current);
return new JobDetailPresentationModel(current, recent25, agentConfig, pipelineWithOneBuild, customizedTabs, trackingTool, artifactService, properties, stage);
}
use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class PipelineHistoryController method list.
@RequestMapping(value = "/tab/pipeline/history", method = RequestMethod.GET)
public ModelAndView list(@RequestParam("pipelineName") String pipelineName) throws Exception {
Map model = new HashMap();
try {
PipelineConfig pipelineConfig = goConfigService.pipelineConfigNamed(new CaseInsensitiveString(pipelineName));
model.put("pipelineName", pipelineConfig.name());
model.put("l", localizer);
model.put("isEditableViaUI", goConfigService.isPipelineEditableViaUI(pipelineName));
return new ModelAndView("pipeline/pipeline_history", model);
} catch (PipelineNotFoundException e) {
model.put("errorMessage", e.getMessage());
return new ModelAndView("exceptions_page", model);
}
}
Aggregations