use of org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition in project workflow-cps-plugin by jenkinsci.
the class DSLTest method runMetaBlockStep.
@Issue("JENKINS-29922")
@Test
public void runMetaBlockStep() throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("circle {echo 'interior is a disk'}", true));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
r.assertLogContains("wrapping in a circle", b);
r.assertLogContains("interior is a disk", b);
p.setDefinition(new CpsFlowDefinition("polygon(17) {echo 'constructible with compass and straightedge'}", true));
b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
r.assertLogContains("wrapping in a 17-gon", b);
r.assertLogContains("constructible with compass and straightedge", b);
}
use of org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition in project workflow-cps-plugin by jenkinsci.
the class DSLTest method flattenGString2.
@Issue("JENKINS-43934")
@Test
public void flattenGString2() throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("echo pops(pojo(/running #$BUILD_NUMBER/))", true));
r.assertLogContains("running #1", r.assertBuildStatusSuccess(p.scheduleBuild2(0)));
}
use of org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition in project workflow-cps-plugin by jenkinsci.
the class DSLTest method metaStepSyntaxForDataBoundSetters.
@Issue("JENKINS-38037")
@Test
public void metaStepSyntaxForDataBoundSetters() throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "metaStepSyntaxForDataBoundSetters");
p.setDefinition(new CpsFlowDefinition("multiShape(count: 2, name: 'pentagon') { echo 'Multiple shapes' }", true));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
r.assertLogContains("wrapping in a group of 2 instances of pentagon", b);
r.assertLogContains("Multiple shapes", b);
}
use of org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition in project workflow-cps-plugin by jenkinsci.
the class DSLTest method dollar_class_must_die.
/**
* Tests the ability to execute meta-step with clean syntax
*/
@Issue("JENKINS-29922")
@Test
public void dollar_class_must_die() throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "die1");
p.setDefinition(new CpsFlowDefinition("california ocean:'pacific', mountain:'sierra'", true));
r.assertLogContains("California from pacific to sierra", r.assertBuildStatusSuccess(p.scheduleBuild2(0)));
}
use of org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition in project workflow-cps-plugin by jenkinsci.
the class DSLTest method dollar_class_must_die_onearg.
/**
* Single argument state
*/
@Issue("JENKINS-29922")
@Test
public void dollar_class_must_die_onearg() throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "die4");
p.setDefinition(new CpsFlowDefinition("newYork 'Empire'", true));
r.assertLogContains("The Empire State", r.assertBuildStatusSuccess(p.scheduleBuild2(0)));
}
Aggregations