Search in sources :

Example 11 with CaseInsensitiveString

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"));
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) Date(java.util.Date) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Test(org.junit.Test)

Example 12 with CaseInsensitiveString

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'."));
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) ParamConfig(com.thoughtworks.go.config.ParamConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) ValidationContext(com.thoughtworks.go.config.ValidationContext) Test(org.junit.Test)

Example 13 with CaseInsensitiveString

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;
}
Also used : DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) MaterialRevision(com.thoughtworks.go.domain.MaterialRevision) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Date(java.util.Date)

Example 14 with CaseInsensitiveString

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);
}
Also used : AgentConfig(com.thoughtworks.go.config.AgentConfig) Tabs(com.thoughtworks.go.config.Tabs) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) JobDetailPresentationModel(com.thoughtworks.go.server.presentation.models.JobDetailPresentationModel) Properties(com.thoughtworks.go.domain.Properties) TrackingTool(com.thoughtworks.go.config.TrackingTool) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Example 15 with CaseInsensitiveString

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);
    }
}
Also used : PipelineConfig(com.thoughtworks.go.config.PipelineConfig) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) ModelAndView(org.springframework.web.servlet.ModelAndView) PipelineNotFoundException(com.thoughtworks.go.config.PipelineNotFoundException) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)373 Test (org.junit.Test)276 Username (com.thoughtworks.go.server.domain.Username)84 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)69 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)65 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)58 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)56 Date (java.util.Date)55 Modification (com.thoughtworks.go.domain.materials.Modification)46 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)30 HashMap (java.util.HashMap)30 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)29 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)27 Before (org.junit.Before)25 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)24 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)24 Pipeline (com.thoughtworks.go.domain.Pipeline)23 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)21 ArrayList (java.util.ArrayList)21 Stage (com.thoughtworks.go.domain.Stage)20