提交 86c5c739 编写于 作者: A abayer

Fixing UpdateSite.neverUpdate and tests to use it properly.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23459 71c3de6d-444a-0410-be80-ed276b4c234a
上级 0431b963
...@@ -549,7 +549,7 @@ public class UpdateSite { ...@@ -549,7 +549,7 @@ public class UpdateSite {
private static final Logger LOGGER = Logger.getLogger(UpdateSite.class.getName()); private static final Logger LOGGER = Logger.getLogger(UpdateSite.class.getName());
public static boolean neverUpdate = Boolean.getBoolean(UpdateCenter.class.getName()+".never"); public static boolean neverUpdate = Boolean.getBoolean(UpdateCenter.class.getName()+".neverUpdate");
/** /**
* Off by default until we know this is reasonably working. * Off by default until we know this is reasonably working.
......
...@@ -240,13 +240,14 @@ public abstract class HudsonTestCase extends TestCase implements RootAction { ...@@ -240,13 +240,14 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
// load updates from local proxy to avoid network traffic. // load updates from local proxy to avoid network traffic.
final String updateCenterUrl = "http://localhost:"+JavaNetReverseProxy.getInstance().localPort+"/update-center.json"; final String updateCenterUrl = "http://localhost:"+JavaNetReverseProxy.getInstance().localPort+"/update-center.json";
PersistedList<UpdateSite> sites = hudson.getUpdateCenter().getSites();
sites.clear();
sites.add(new UpdateSite("default", updateCenterUrl));
// don't waste bandwidth talking to the update center // don't waste bandwidth talking to the update center
DownloadService.neverUpdate = true; DownloadService.neverUpdate = true;
UpdateCenter.neverUpdate = true; UpdateCenter.neverUpdate = true;
UpdateSite.neverUpdate = true;
PersistedList<UpdateSite> sites = hudson.getUpdateCenter().getSites();
sites.clear();
sites.add(new UpdateSite("default", updateCenterUrl));
// expose the test instance as a part of URL tree. // expose the test instance as a part of URL tree.
// this allows tests to use a part of the URL space for itself. // this allows tests to use a part of the URL space for itself.
......
...@@ -37,9 +37,10 @@ public class UpdateCenter2Test extends HudsonTestCase { ...@@ -37,9 +37,10 @@ public class UpdateCenter2Test extends HudsonTestCase {
*/ */
void testInstall() { void testInstall() {
UpdateCenter.neverUpdate = false; UpdateCenter.neverUpdate = false;
UpdateSite.neverUpdate = false;
createWebClient().goTo("/") // load the metadata createWebClient().goTo("/") // load the metadata
def job = hudson.updateCenter.getPlugin("changelog-history").deploy().get(); // this seems like one of the smallest plugin def job = hudson.updateCenter.getPlugin("changelog-history").deploy().get(); // this seems like one of the smallest plugin
println job.status; println job.status;
assertTrue(job.status instanceof Success) assertTrue(job.status instanceof Success)
} }
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册