added a convenience method

This commit is contained in:
Kohsuke Kawaguchi committed 2011-04-01 15:01:07 -07:00
1 parent 4fe1df8686
commit a895bce94a
1 file changed
+10
@@ -846,6 +846,16 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
return (C)computerConnectorTester.connector;
}
protected User configRoundtrip(User u) throws Exception {
submit(createWebClient().goTo(u.getUrl()+"/configure").getFormByName("config"));
return u;
}
protected <N extends Node> N configRoundtrip(N node) throws Exception {
submit(createWebClient().goTo("/computer/"+node.getNodeName()+"/configure").getFormByName("config"));
return (N)hudson.getNode(node.getNodeName());
}
protected <V extends View> V configRoundtrip(V view) throws Exception {
submit(createWebClient().getPage(view, "configure").getFormByName("viewConfig"));
return view;