提交 2ae2e1d2 编写于 作者: K kohsuke

added a convenient test assertion method that makes sure help files for...

added a convenient test assertion method that makes sure help files for properties exist and render correctly.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@30036 71c3de6d-444a-0410-be80-ed276b4c234a
上级 e472afa9
......@@ -35,10 +35,7 @@ import hudson.EnvVars;
import hudson.ExtensionList;
import hudson.DescriptorExtensionList;
import hudson.Util;
import hudson.model.AbstractBuild;
import hudson.model.Computer;
import hudson.model.Executor;
import hudson.model.Job;
import hudson.model.*;
import hudson.model.Queue.Executable;
import hudson.security.AbstractPasswordBasedSecurityRealm;
import hudson.security.GroupDetails;
......@@ -52,23 +49,6 @@ import hudson.matrix.MatrixBuild;
import hudson.matrix.MatrixRun;
import hudson.maven.MavenModuleSet;
import hudson.maven.MavenEmbedder;
import hudson.model.Descriptor;
import hudson.model.DownloadService;
import hudson.model.FreeStyleProject;
import hudson.model.Hudson;
import hudson.model.Item;
import hudson.model.JDK;
import hudson.model.Label;
import hudson.model.Node;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.Saveable;
import hudson.model.TaskListener;
import hudson.model.UpdateSite;
import hudson.model.AbstractProject;
import hudson.model.View;
import hudson.model.RootAction;
import hudson.model.User;
import hudson.model.Node.Mode;
import hudson.security.csrf.CrumbIssuer;
import hudson.slaves.CommandLauncher;
......@@ -818,6 +798,29 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
}
}
/**
* Asserts that help files exist for the specified properties of the given instance.
*
* @param type
* The describable class type that should have the associated help files.
* @param properties
* ','-separated list of properties whose help files should exist.
*/
public void assertHelpExists(final Class<? extends Describable> type, final String properties) throws Exception {
executeOnServer(new Callable<Object>() {
public Object call() throws Exception {
Descriptor d = hudson.getDescriptor(type);
WebClient wc = createWebClient();
for (String property : properties.split(",")) {
String url = d.getHelpFile(property);
assertNotNull("Help file for the property "+property+" is missing on "+type, url);
wc.goTo(url); // make sure it successfully loads
}
return null;
}
});
}
/**
* Submits the form.
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册