Skip to content

Commit

Permalink
[JENKINS-41248] Verify that explicit setter methods take priority.
Browse files Browse the repository at this point in the history
  • Loading branch information
abayer committed Aug 8, 2017
1 parent 329f900 commit 85d0325
Showing 1 changed file with 21 additions and 0 deletions.
Expand Up @@ -254,4 +254,25 @@ public void gStringInMapKey() throws Exception {
jenkins.assertLogContains("second-1:second-key", b);
jenkins.assertLogContains("third-1:third-key", b);
}

@Issue("JENKINS-41248")
@Test
public void explicitSetter() throws Exception {
WorkflowJob job = jenkins.jenkins.createProject(WorkflowJob.class, "p");
job.setDefinition(new CpsFlowDefinition("class Foo {\n" +
" private int a\n" +
" void setA(int a) {\n" +
" this.a = a\n" +
" }\n" +
" String getA() {\n" +
" return a\n" +
" }\n" +
"}\n" +
"Foo foo = new Foo()\n" +
"foo.setA(10)\n" +
"echo \"a is ${foo.getA()}\"", true));
WorkflowRun b = jenkins.buildAndAssertSuccess(job);

jenkins.assertLogContains("a is 10", b);
}
}

0 comments on commit 85d0325

Please sign in to comment.