diff --git a/changelog.html b/changelog.html index ed5d4ae9b91cf7c42cbe0f6668fb94420b230402..eb56a756e1a692dccb33d2a2509ad3997300e4b9 100644 --- a/changelog.html +++ b/changelog.html @@ -58,6 +58,9 @@ Upcoming changes
  • Provided maven settings.xml in maven builder is lost. (issue 15976) +
  • + Fixed a regression that broke some plugins' form validation + (issue 18776) diff --git a/core/pom.xml b/core/pom.xml index f7aa5a8e279a8b35ebffdb6df7549286889504a5..95e1af1fccacd63bf76eed8f44968ebfeeb69b73 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -42,7 +42,7 @@ THE SOFTWARE. true - 1.213 + 1.214 2.5.6.SEC03 diff --git a/test/pom.xml b/test/pom.xml index da1db18af8a0141ea0ea52b9f561797fd066a515..8742f7729998934a1182baf2c8e6577dcf480d26 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -193,6 +193,28 @@ THE SOFTWARE. true + + org.codehaus.gmaven + gmaven-plugin + + + + test-in-groovy + + + generateTestStubs + testCompile + + + + + + ant + ant + 1.6.5 + + + org.kohsuke.gmaven gmaven-plugin @@ -208,13 +230,6 @@ THE SOFTWARE. ${pom.basedir}/src/main/preset-data/package.groovy - - test-in-groovy - - - testCompile - - diff --git a/test/src/test/groovy/hudson/RelativePathTest.groovy b/test/src/test/groovy/hudson/RelativePathTest.groovy new file mode 100644 index 0000000000000000000000000000000000000000..b135bc906ccb768387d20780009e283db40644f3 --- /dev/null +++ b/test/src/test/groovy/hudson/RelativePathTest.groovy @@ -0,0 +1,65 @@ +package hudson + +import hudson.model.AbstractDescribableImpl +import hudson.model.Describable +import hudson.model.Descriptor +import hudson.util.ListBoxModel +import org.jvnet.hudson.test.Bug +import org.jvnet.hudson.test.HudsonTestCase +import org.jvnet.hudson.test.TestExtension +import org.kohsuke.stapler.QueryParameter + +/** + * Regression test for JENKINS-18776 + * + * @author Kohsuke Kawaguchi + */ +class RelativePathTest extends HudsonTestCase implements Describable { + @Bug(18776) + void testRelativePath() { + // I was having trouble causing annotation processing on test stubs + jenkins.getDescriptorOrDie(RelativePathTest.class) + jenkins.getDescriptorOrDie(Model.class) + + createWebClient().goTo("/self/"); + assert jenkins.getDescriptorOrDie(Model.class).touched + } + + String getName() { + return "Alice"; + } + + Model getModel() { + return new Model(); + } + + DescriptorImpl getDescriptor() { + return jenkins.getDescriptorOrDie(getClass()); + } + + @TestExtension + static class DescriptorImpl extends Descriptor { + @Override + String getDisplayName() { + return ""; + } + } + + static class Model extends AbstractDescribableImpl { + @TestExtension + static class DescriptorImpl extends Descriptor { + boolean touched; + + @Override + String getDisplayName() { + return "test"; + } + + ListBoxModel doFillAbcItems(@RelativePath("..") @QueryParameter String name) { + assert name=="Alice"; + touched = true; + return new ListBoxModel().add("foo").add("bar") + } + } + } +} diff --git a/test/src/test/resources/hudson/RelativePathTest/Model/config.groovy b/test/src/test/resources/hudson/RelativePathTest/Model/config.groovy new file mode 100644 index 0000000000000000000000000000000000000000..cd17d550a20de15f678dfe2a4a2c63fc8cc5974d --- /dev/null +++ b/test/src/test/resources/hudson/RelativePathTest/Model/config.groovy @@ -0,0 +1,5 @@ +def f= namespace(lib.FormTagLib) + +f.entry(field:"abc") { + f.select() +} \ No newline at end of file diff --git a/test/src/test/resources/hudson/RelativePathTest/index.groovy b/test/src/test/resources/hudson/RelativePathTest/index.groovy new file mode 100644 index 0000000000000000000000000000000000000000..4ee16e1b71b1964acd45f1d7f037f5358dcee3b9 --- /dev/null +++ b/test/src/test/resources/hudson/RelativePathTest/index.groovy @@ -0,0 +1,18 @@ +package hudson.RelativePathTest + +def l = namespace(lib.LayoutTagLib) +def j = namespace("jelly:core") +def f= namespace(lib.FormTagLib) + +l.layout { + l.main_panel { + set("instance",my) + set("descriptor",my.descriptor) + f.form() { + f.entry(field:"name") { + f.textbox() + } + f.property(field:"model") + } + } +}