use of com.thoughtworks.go.domain.label.PipelineLabel in project gocd by gocd.
the class PipelineLabelTest method shouldUseCounterAsDefaultTemplate.
@Test
public void shouldUseCounterAsDefaultTemplate() throws Exception {
PipelineLabel defaultLabel = PipelineLabel.defaultLabel();
assertThat(defaultLabel.toString(), is("${COUNT}"));
}
use of com.thoughtworks.go.domain.label.PipelineLabel in project gocd by gocd.
the class PipelineLabelTest method getReplacedLabelFor.
private PipelineLabel getReplacedLabelFor(String name, String labelFormat) {
MaterialRevisions materialRevisions = ModificationsMother.oneUserOneFile();
PipelineLabel label = PipelineLabel.create(labelFormat);
((SvnMaterial) materialRevisions.getRevisions().get(0).getMaterial()).setName(new CaseInsensitiveString(name));
label.updateLabel(materialRevisions.getNamedRevisions());
return label;
}
use of com.thoughtworks.go.domain.label.PipelineLabel in project gocd by gocd.
the class PipelineLabelTest method shouldReplaceTheTemplateWithGitMaterialRevision.
@Test
public void shouldReplaceTheTemplateWithGitMaterialRevision() throws Exception {
PipelineLabel label = PipelineLabel.create("release-${svnMaterial}-${git}");
MaterialRevisions materialRevisions = ModificationsMother.oneUserOneFile();
ScmMaterial material = MaterialsMother.gitMaterial("");
material.setName(new CaseInsensitiveString("git"));
Modification modification = new Modification();
modification.setRevision("8c8a273e12a45e57fed5ce978d830eb482f6f666");
materialRevisions.addRevision(material, modification);
label.updateLabel(materialRevisions.getNamedRevisions());
assertThat(label.toString(), is("release-" + ModificationsMother.currentRevision() + "-8c8a273e12a45e57fed5ce978d830eb482f6f666"));
}
use of com.thoughtworks.go.domain.label.PipelineLabel in project gocd by gocd.
the class PipelineLabelTest method assertLabelGroupsMatchingAndReplace.
private String assertLabelGroupsMatchingAndReplace(String labelTemplate, String[][] expectedGroups) throws Exception {
assertLabelGroupsMatching(labelTemplate, expectedGroups);
PipelineLabel label = new PipelineLabel(labelTemplate);
label.updateLabel(MATERIAL_REVISIONS);
return label.toString();
}
use of com.thoughtworks.go.domain.label.PipelineLabel in project gocd by gocd.
the class PipelineLabelTest method shouldCreateDefaultLabelIfTemplateIsNull.
@Test
public void shouldCreateDefaultLabelIfTemplateIsNull() {
PipelineLabel label = PipelineLabel.create(null);
assertThat(label, Is.is(PipelineLabel.defaultLabel()));
}
Aggregations