Skip to content
Permalink
Browse files
[FIXED JENKINS-18776]
This reverts commit c9eb236.
  • Loading branch information
olivergondza committed Sep 19, 2013
1 parent 998dc0d commit 9335c4446faf73a7c58d8189874e1dd2fccf5b5e
@@ -195,10 +195,18 @@ THE SOFTWARE.
</configuration>
</plugin>
<plugin>
<groupId>org.kohsuke.gmaven</groupId>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<!-- version specified in grandparent pom -->
<executions>
<execution>
<id>default</id>
<!-- compile and process annotations in Groovy test code -->
<goals>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
</execution>
<execution>
<id>preset-packager</id>
<phase>process-resources</phase>
@@ -209,13 +217,6 @@ THE SOFTWARE.
<source>${pom.basedir}/src/main/preset-data/package.groovy</source>
</configuration>
</execution>
<execution>
<id>test-in-groovy</id>
<!-- allow tests written in Groovy -->
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
@@ -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<RelativePathTest> {
@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<RelativePathTest> {
@Override
String getDisplayName() {
return "";
}
}

static class Model extends AbstractDescribableImpl<Model> {
@TestExtension
static class DescriptorImpl extends Descriptor<Model> {
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")
}
}
}
}
@@ -0,0 +1,5 @@
def f= namespace(lib.FormTagLib)

f.entry(field:"abc") {
f.select()
}
@@ -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")
}
}
}

0 comments on commit 9335c44

Please sign in to comment.