Skip to content
Permalink
Browse files

Merge pull request #157 from jglick/final-fields-JENKINS-34599

[JENKINS-34599] [JENKINS-45629] Demonstrating fixes
  • Loading branch information...
jglick committed Jul 25, 2017
2 parents bcca226 + 5296854 commit ebd87bb3e42318e3f0d8a68d00529999fd2fa248
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition2Test.java
@@ -77,6 +77,15 @@
jenkins.configRoundtrip(job);
}

@Issue({"JENKINS-34599", "JENKINS-45629"})
@Test public void fieldInitializers() 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));
p.setDefinition(new CpsFlowDefinition("class X {String world = 'world'; String message = 'hello ' + world}; echo(new X().message)", true));
jenkins.assertLogContains("hello world", jenkins.buildAndAssertSuccess(p));
}

@Issue("JENKINS-42563")
@Test
public void superCallsSandboxed() throws Exception {

0 comments on commit ebd87bb

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