Skip to content
Permalink
Browse files

Merge pull request #212 from abayer/jenkins-45982

[JENKINS-45982] Fix calling CPS-transformed super methods.
  • Loading branch information...
abayer committed Mar 23, 2018
2 parents a63e684 + 6721222 commit 7ac0d46ce3ef04525a74570962328a12adea9add
Showing with 23 additions and 2 deletions.
  1. +2 −2 pom.xml
  2. +21 −0 src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition2Test.java
@@ -68,7 +68,7 @@
<git-plugin.version>3.1.0</git-plugin.version>
<workflow-support-plugin.version>2.17</workflow-support-plugin.version>
<scm-api-plugin.version>2.0.8</scm-api-plugin.version>
<groovy-cps.version>1.23</groovy-cps.version>
<groovy-cps.version>1.24</groovy-cps.version>
<jenkins-test-harness.version>2.33</jenkins-test-harness.version>
</properties>
<dependencies>
@@ -95,7 +95,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<version>1.39</version>
<version>1.42</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -465,4 +465,25 @@ public void multipleAssignmentFunctionCalledOnce() throws Exception {
"assert a+b+c+d == 'firstsecondthirdfourth'\n", true));
jenkins.buildAndAssertSuccess(job);
}

@Issue("JENKINS-45982")
@Test
public void transformedSuperClass() throws Exception {
WorkflowJob job = jenkins.jenkins.createProject(WorkflowJob.class, "p");
job.setDefinition(new CpsFlowDefinition("class Foo {\n" +
" public String other() {\n" +
" return 'base'\n" +
" }\n" +
"}\n" +
"class Bar extends Foo {\n" +
" public String other() {\n" +
" return 'y'+super.other()\n" +
" }\n" +
"}\n" +
"String output = new Bar().other()\n" +
"echo 'OUTPUT: ' + output\n" +
"assert output == 'ybase'\n", true));
WorkflowRun r = jenkins.buildAndAssertSuccess(job);
jenkins.assertLogContains("OUTPUT: ybase", r);
}
}

0 comments on commit 7ac0d46

Please sign in to comment.
You can’t perform that action at this time.