From d1ab9c5bf562c375db79ef86edaf97436772c28c Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 18 Aug 2009 17:03:47 +0000 Subject: [PATCH] - more groovy support - reset UpdateCenter every time for better isolation. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20834 71c3de6d-444a-0410-be80-ed276b4c234a --- .../java/org/jvnet/hudson/test/HudsonTestCase.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 1af3067d48..0b786b2201 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -233,7 +233,9 @@ public abstract class HudsonTestCase extends TestCase { return updateCenterUrl; } }); + // don't waste bandwidth talking to the update center DownloadService.neverUpdate = true; + UpdateCenter.neverUpdate = true; // cause all the descriptors to reload. // ideally we'd like to reset them to properly emulate the behavior, but that's not possible. @@ -839,6 +841,13 @@ public abstract class HudsonTestCase extends TestCase { throw new AssertionError("HudsonTestCase "+getName()+" is not supposed to be serialized"); } + /** + * This is to assist Groovy test clients who are incapable of instantiating the inner classes properly. + */ + public WebClient createWebClient() { + return new WebClient(); + } + /** * Extends {@link com.gargoylesoftware.htmlunit.WebClient} and provide convenience methods * for accessing Hudson. @@ -1004,8 +1013,6 @@ public abstract class HudsonTestCase extends TestCase { static { // screen scraping relies on locale being fixed. Locale.setDefault(Locale.ENGLISH); - // don't waste bandwidth talking to the update center - UpdateCenter.neverUpdate = true; {// enable debug assistance, since tests are often run from IDE Dispatcher.TRACE = true;