From d995cea432cf94f5190fdd81a70a509e3b680a5c Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 14 May 2010 17:06:56 +0000 Subject: [PATCH] added more convenience methods. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31039 71c3de6d-444a-0410-be80-ed276b4c234a --- .../org/jvnet/hudson/test/HudsonTestCase.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java index 1bf2225b46..1a01dfa4f3 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -36,6 +36,8 @@ import hudson.model.Queue.Executable; import hudson.security.AbstractPasswordBasedSecurityRealm; import hudson.security.GroupDetails; import hudson.security.SecurityRealm; +import hudson.tasks.Builder; +import hudson.tasks.Publisher; import hudson.tools.ToolProperty; import hudson.remoting.Which; import hudson.Launcher.LocalLauncher; @@ -663,6 +665,25 @@ public abstract class HudsonTestCase extends TestCase implements RootAction { return job; } + /** + * Performs a configuration round-trip testing for a builder. + */ + protected B configRoundtrip(B before) throws Exception { + FreeStyleProject p = createFreeStyleProject(); + p.getBuildersList().add(before); + configRoundtrip(p); + return (B)p.getBuildersList().get(before.getClass()); + } + + /** + * Performs a configuration round-trip testing for a publisher. + */ + protected

P configRoundtrip(P before) throws Exception { + FreeStyleProject p = createFreeStyleProject(); + p.getPublishersList().add(before); + configRoundtrip(p); + return (P)p.getPublishersList().get(before.getClass()); + } /** -- GitLab