diff --git a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java index 093fe09f2738704c570aa80ad4655d0a0b555967..0f42deea32219bdb28dc0b4f4c669a39a0e728a8 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -153,7 +153,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest; * @see Wiki article about unit testing in Hudson * @author Kohsuke Kawaguchi */ -public abstract class HudsonTestCase extends TestCase { +public abstract class HudsonTestCase extends TestCase implements RootAction { public Hudson hudson; protected final TestEnvironment env = new TestEnvironment(); @@ -243,6 +243,10 @@ public abstract class HudsonTestCase extends TestCase { DownloadService.neverUpdate = true; UpdateCenter.neverUpdate = true; + // expose the test instance as a part of URL tree. + // this allows tests to use a part of the URL space for itself. + hudson.getActions().add(this); + // cause all the descriptors to reload. // ideally we'd like to reset them to properly emulate the behavior, but that's not possible. Mailer.descriptor().setHudsonUrl(null); @@ -290,6 +294,18 @@ public abstract class HudsonTestCase extends TestCase { } } + public String getIconFileName() { + return null; + } + + public String getDisplayName() { + return null; + } + + public String getUrlName() { + return "self"; + } + /** * Creates a new instance of {@link Hudson}. If the derived class wants to create it in a different way, * you can override it.