提交 f3858913 编写于 作者: K kohsuke

Integrates the test case into a URL tree. Behavior explained in...

Integrates the test case into a URL tree. Behavior explained in http://wiki.hudson-ci.org/display/HUDSON/Unit+Test

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@22027 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f9a02840
......@@ -153,7 +153,7 @@ import com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest;
* @see <a href="http://hudson.gotdns.com/wiki/display/HUDSON/Unit+Test">Wiki article about unit testing in Hudson</a>
* @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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册