Skip to content

Commit 6721222

Browse files
committed
[JENKINS-45982] Fix calling CPS-transformed super methods.
1 parent 78b137d commit 6721222

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<git-plugin.version>3.1.0</git-plugin.version>
6969
<workflow-support-plugin.version>2.17</workflow-support-plugin.version>
7070
<scm-api-plugin.version>2.0.8</scm-api-plugin.version>
71-
<groovy-cps.version>1.23</groovy-cps.version>
71+
<groovy-cps.version>1.24</groovy-cps.version>
7272
<jenkins-test-harness.version>2.33</jenkins-test-harness.version>
7373
</properties>
7474
<dependencies>
@@ -95,7 +95,7 @@
9595
<dependency>
9696
<groupId>org.jenkins-ci.plugins</groupId>
9797
<artifactId>script-security</artifactId>
98-
<version>1.39</version>
98+
<version>1.42</version>
9999
</dependency>
100100
<dependency>
101101
<groupId>org.jenkins-ci.plugins</groupId>

src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition2Test.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,4 +465,25 @@ public void multipleAssignmentFunctionCalledOnce() throws Exception {
465465
"assert a+b+c+d == 'firstsecondthirdfourth'\n", true));
466466
jenkins.buildAndAssertSuccess(job);
467467
}
468+
469+
@Issue("JENKINS-45982")
470+
@Test
471+
public void transformedSuperClass() throws Exception {
472+
WorkflowJob job = jenkins.jenkins.createProject(WorkflowJob.class, "p");
473+
job.setDefinition(new CpsFlowDefinition("class Foo {\n" +
474+
" public String other() {\n" +
475+
" return 'base'\n" +
476+
" }\n" +
477+
"}\n" +
478+
"class Bar extends Foo {\n" +
479+
" public String other() {\n" +
480+
" return 'y'+super.other()\n" +
481+
" }\n" +
482+
"}\n" +
483+
"String output = new Bar().other()\n" +
484+
"echo 'OUTPUT: ' + output\n" +
485+
"assert output == 'ybase'\n", true));
486+
WorkflowRun r = jenkins.buildAndAssertSuccess(job);
487+
jenkins.assertLogContains("OUTPUT: ybase", r);
488+
}
468489
}

0 commit comments

Comments
 (0)