Skip to content

Commit

Permalink
[JENKINS-45982] Fix calling CPS-transformed super methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
abayer committed Mar 12, 2018
1 parent 78b137d commit 6721222
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
Expand Up @@ -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 6721222

Please sign in to comment.