Skip to content

Commit

Permalink
[JENKINS-34599] Demonstrating that fix also works in CPS mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Jul 13, 2017
1 parent b476ea4 commit f9ddb92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -93,7 +93,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<version>1.29</version>
<version>1.30-20170713.204356-2</version> <!-- TODO https://github.com/jenkinsci/script-security-plugin/pull/132 -->
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Expand Up @@ -77,6 +77,13 @@ public class CpsFlowDefinition2Test extends AbstractCpsFlowTest {
jenkins.configRoundtrip(job);
}

@Issue("JENKINS-34599")
@Test public void finalFields() throws Exception {
WorkflowJob p = jenkins.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("class X {final String val; X(String _val) {val = _val}}; echo(/hello ${new X('world').val}/)", true));
jenkins.assertLogContains("hello world", jenkins.buildAndAssertSuccess(p));
}

@Test
public void sandboxInvokerUsed() throws Exception {
WorkflowJob job = jenkins.jenkins.createProject(WorkflowJob.class, "p");
Expand Down

0 comments on commit f9ddb92

Please sign in to comment.