提交 da9baa17 编写于 作者: H huybrechts

fixed login() and getContextPath() when working with non-root context

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20576 71c3de6d-444a-0410-be80-ed276b4c234a
上级 9d55900f
......@@ -157,7 +157,7 @@ public abstract class HudsonTestCase extends TestCase {
protected Server server;
/**
* Where in the {@link Server} is Hudson deploed?
* Where in the {@link Server} is Hudson deployed?
*/
protected String contextPath = "/";
......@@ -822,7 +822,7 @@ public abstract class HudsonTestCase extends TestCase {
* Logs in to Hudson.
*/
public WebClient login(String username, String password) throws Exception {
HtmlPage page = goTo("login");
HtmlPage page = goTo("/login");
// page = (HtmlPage) page.getFirstAnchorByText("Login").click();
HtmlForm form = page.getFormByName("login");
......@@ -928,7 +928,7 @@ public abstract class HudsonTestCase extends TestCase {
* URL ends with '/'.
*/
public String getContextPath() {
return "http://localhost:"+localPort+contextPath;
return "http://localhost:"+localPort+contextPath+"/";
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册