Skip to content

Commit

Permalink
Merge pull request #157 from jglick/final-fields-JENKINS-34599
Browse files Browse the repository at this point in the history
[JENKINS-34599] [JENKINS-45629] Demonstrating fixes
  • Loading branch information
jglick committed Jul 25, 2017
2 parents bcca226 + 5296854 commit ebd87bb
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -77,6 +77,15 @@ public class CpsFlowDefinition2Test extends AbstractCpsFlowTest {
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 {
Expand Down

0 comments on commit ebd87bb

Please sign in to comment.