提交 211ca895 编写于 作者: K kohsuke

Fixed a test broken by rev.14457.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14487 71c3de6d-444a-0410-be80-ed276b4c234a
上级 316496aa
......@@ -415,6 +415,14 @@ public abstract class HudsonTestCase extends TestCase {
fail("Console output of "+run+" didn't contain "+substring);
}
/**
* Asserts that the XPath matches.
*/
public void assertXPath(HtmlPage page, String xpath) {
assertNotNull("There should be an object that matches XPath:"+xpath,
page.getDocumentElement().selectSingleNode(xpath));
}
/**
* Submits the form.
*/
......
......@@ -6,6 +6,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.model.PageDecorator;
import net.sf.json.JSONObject;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.Bug;
import org.kohsuke.stapler.StaplerRequest;
public class SystemConfigurationTestCase extends HudsonTestCase {
......@@ -22,13 +23,14 @@ public class SystemConfigurationTestCase extends HudsonTestCase {
/**
* Asserts that bug#2289 is fixed.
*/
@Bug(2289)
public void testPageDecoratorIsListedInPage() throws Exception {
pageDecoratorImpl = new PageDecoratorImpl();
PageDecorator.ALL.add(pageDecoratorImpl);
HtmlPage page = new WebClient().goTo("configure");
assertElementPresent(page, "hudson-pages-SystemConfigurationTestCase$PageDecoratorImpl");
assertXPath(page,"//tr[@name='hudson-pages-SystemConfigurationTestCase$PageDecoratorImpl']");
HtmlForm form = page.getFormByName("config");
form.getInputByName("_.decoratorId").setValueAttribute("this_is_a_profile");
submit(form);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册