added a link check test

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14070 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-01-01 00:36:33 +00:00
1 parent b8001174f3
commit 9bfbba92ea
2 files changed
+27 -1

No files matched your search

@@ -8,7 +8,7 @@
<d:tag name="feature">
<t:summary icon="${icon}"
href="${href}" iconOnly="true">
<div><a href="${href}">${title}</a></div>
<div class="link"><a href="${href}">${title}</a></div>
<div style="color:gray; text-decoration:none;">
<d:invokeBody />
</div>
@@ -0,0 +1,26 @@
package hudson.model;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.jvnet.hudson.test.HudsonTestCase;
import java.util.List;
/**
* @author Kohsuke Kawaguchi
*/
public class ManagementLinkTest extends HudsonTestCase {
/**
* Makes sure every link works.
*/
public void testLinks() throws Exception {
HtmlPage page = new WebClient().goTo("manage");
List<?> anchors = page.selectNodes("id('management-links')//*[@class='link']/a");
assertTrue(anchors.size()>=8);
for(HtmlAnchor e : (List<HtmlAnchor>) anchors) {
if(e.getHrefAttribute().endsWith("reload"))
continue; // can't really click this
e.click();
}
}
}