From cbb3e313ad90c63d62b1ccfaeabb004edcee1496 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 26 Aug 2009 15:13:55 +0000 Subject: [PATCH] Merged revisions 20928-20929,20939,20974-20975,20988,21009,21011,21015 via svnmerge from https://www.dev.java.net/svn/hudson/branches/rc ........ r20928 | kohsuke | 2009-08-19 14:47:13 -0700 (Wed, 19 Aug 2009) | 1 line test bug fix. ........ r20929 | kohsuke | 2009-08-19 14:48:23 -0700 (Wed, 19 Aug 2009) | 1 line bumped up to a new version that has a trouble-shooting hook for resetting cached views ........ r20939 | kohsuke | 2009-08-19 15:20:57 -0700 (Wed, 19 Aug 2009) | 1 line picking up subversion 1.5 ........ r20974 | kohsuke | 2009-08-20 11:50:04 -0700 (Thu, 20 Aug 2009) | 3 lines Hudson can make mistakes in binding plugins to their right /plugin/NAME/ URLs. (report) ........ r20975 | kohsuke | 2009-08-20 12:05:11 -0700 (Thu, 20 Aug 2009) | 1 line Build history AJX update was buggy. ........ r20988 | kohsuke | 2009-08-20 17:01:57 -0700 (Thu, 20 Aug 2009) | 3 lines Hudson wasn't working on WebLogic on Windows. (report) ........ r21009 | kohsuke | 2009-08-21 14:21:35 -0700 (Fri, 21 Aug 2009) | 1 line [maven-release-plugin] prepare release hudson- ........ r21011 | kohsuke | 2009-08-21 14:22:00 -0700 (Fri, 21 Aug 2009) | 1 line [maven-release-plugin] prepare for next development iteration ........ r21015 | kohsuke | 2009-08-21 16:00:17 -0700 (Fri, 21 Aug 2009) | 1 line updated changelog as a part of the release ........ git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21095 71c3de6d-444a-0410-be80-ed276b4c234a --- cli/pom.xml | 2 +- core/pom.xml | 4 +-- .../java/hudson/ClassicPluginStrategy.java | 3 +- core/src/main/java/hudson/Plugin.java | 5 ++-- .../java/hudson/widgets/HistoryWidget.java | 2 +- debian/changelog | 6 ++++ maven-agent/pom.xml | 2 +- maven-interceptor/pom.xml | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- remoting/pom.xml | 2 +- .../src/main/java/hudson/remoting/Which.java | 9 +++--- test/pom.xml | 2 +- .../org/jvnet/hudson/test/HudsonTestCase.java | 29 +++++++++++++++++++ war/pom.xml | 4 +-- 15 files changed, 57 insertions(+), 19 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index 0edf9448b8..98a3f2d6b8 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -4,7 +4,7 @@ pom org.jvnet.hudson.main - 1.321-SNAPSHOT + 1.322-SNAPSHOT cli Hudson CLI diff --git a/core/pom.xml b/core/pom.xml index 1fa50b6d9d..9d91a6ef97 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.321-SNAPSHOT + 1.322-SNAPSHOT ../pom.xml @@ -319,7 +319,7 @@ THE SOFTWARE. org.kohsuke.stapler stapler-jelly - 1.109 + 1.110 dom4j diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index bc6094b32b..554ec1c15c 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -27,6 +27,7 @@ import hudson.PluginWrapper.Dependency; import hudson.util.IOException2; import hudson.util.MaskingClassLoader; import hudson.util.VersionNumber; +import hudson.Plugin.DummyImpl; import java.io.BufferedReader; import java.io.File; @@ -246,7 +247,7 @@ public class ClassicPluginStrategy implements PluginStrategy { String className = wrapper.getPluginClass(); if(className==null) { // use the default dummy instance - wrapper.setPlugin(Plugin.NONE); + wrapper.setPlugin(new DummyImpl()); } else { try { Class clazz = wrapper.classLoader.loadClass(className); diff --git a/core/src/main/java/hudson/Plugin.java b/core/src/main/java/hudson/Plugin.java index 033cbcbc9f..001a88b090 100644 --- a/core/src/main/java/hudson/Plugin.java +++ b/core/src/main/java/hudson/Plugin.java @@ -243,11 +243,12 @@ public abstract class Plugin implements Saveable { new File(Hudson.getInstance().getRootDir(),wrapper.getShortName()+".xml")); } + /** * Dummy instance of {@link Plugin} to be used when a plugin didn't * supply one on its own. * - * @since 1.288 + * @since 1.321 */ - public static final Plugin NONE = new Plugin() {}; + public static final class DummyImpl extends Plugin {} } diff --git a/core/src/main/java/hudson/widgets/HistoryWidget.java b/core/src/main/java/hudson/widgets/HistoryWidget.java index 0a98326e62..f147e7992a 100644 --- a/core/src/main/java/hudson/widgets/HistoryWidget.java +++ b/core/src/main/java/hudson/widgets/HistoryWidget.java @@ -117,7 +117,7 @@ public class HistoryWidget extends Widget { if (baseList instanceof List) { lst = (List) baseList; if(lst.size()>THRESHOLD) - return lst.subList(0,THRESHOLD); + return updateFirstTransientBuildKey(lst.subList(0,THRESHOLD)); trimmed=false; return updateFirstTransientBuildKey(lst); } else { diff --git a/debian/changelog b/debian/changelog index b3695a8983..cce0b8dd22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +hudson (1.321) unstable; urgency=low + + * See http://hudson.dev.java.net/changelog.html for more details. + + -- Kohsuke Kawaguchi Fri, 21 Aug 2009 15:59:27 -0700 + hudson (1.320) unstable; urgency=low * See http://hudson.dev.java.net/changelog.html for more details. diff --git a/maven-agent/pom.xml b/maven-agent/pom.xml index 6dbceffc50..54cf599081 100644 --- a/maven-agent/pom.xml +++ b/maven-agent/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.321-SNAPSHOT + 1.322-SNAPSHOT ../pom.xml diff --git a/maven-interceptor/pom.xml b/maven-interceptor/pom.xml index fe03bb29f5..8ebe6039df 100644 --- a/maven-interceptor/pom.xml +++ b/maven-interceptor/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.321-SNAPSHOT + 1.322-SNAPSHOT ../pom.xml diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 91dffe5abf..06b894629c 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.321-SNAPSHOT + 1.322-SNAPSHOT maven-plugin diff --git a/pom.xml b/pom.xml index ce0d2f245d..99dcfa3095 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.321-SNAPSHOT + 1.322-SNAPSHOT pom Hudson main module diff --git a/remoting/pom.xml b/remoting/pom.xml index 53f64666b1..446a059220 100644 --- a/remoting/pom.xml +++ b/remoting/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.321-SNAPSHOT + 1.322-SNAPSHOT ../pom.xml diff --git a/remoting/src/main/java/hudson/remoting/Which.java b/remoting/src/main/java/hudson/remoting/Which.java index d96b1ac8b6..e89c906e07 100644 --- a/remoting/src/main/java/hudson/remoting/Which.java +++ b/remoting/src/main/java/hudson/remoting/Which.java @@ -83,12 +83,13 @@ public class Which { return new File(decode(new URL("file:/"+resURL).getPath())); } - if(resURL.startsWith("zip:/")){ + if(resURL.startsWith("zip:")){ // weblogic uses this. See http://www.nabble.com/patch-to-get-Hudson-working-on-weblogic-td23997258.html - resURL = resURL.substring("zip:/".length(), resURL.lastIndexOf('!')); // cut off zip: and the file name portion - return new File(decode(new URL("file:/"+resURL).getPath())); + // also see http://www.nabble.com/Re%3A-Hudson-on-Weblogic-10.3-td25038378.html#a25043415 + resURL = resURL.substring("zip:".length(), resURL.lastIndexOf('!')); // cut off zip: and the file name portion + return new File(decode(new URL("file:"+resURL).getPath())); } - + if(resURL.startsWith("file:")) { // unpackaged classes int n = clazz.getName().split("\\.").length; // how many slashes do wo need to cut? diff --git a/test/pom.xml b/test/pom.xml index 7c3248e333..481cb3464b 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. pom org.jvnet.hudson.main - 1.321-SNAPSHOT + 1.322-SNAPSHOT 4.0.0 org.jvnet.hudson.main 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 4517b1cefe..307e34cb3b 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -846,6 +846,35 @@ public abstract class HudsonTestCase extends TestCase { return this; } + /** + * Executes the given closure on the server, in the context of an HTTP request. + * This is useful for testing some methods that require {@link StaplerRequest} and {@link StaplerResponse}. + * + *

+ * The closure will get the request and response as parameters. + */ + public Object executeOnServer(final Closure c) throws Throwable { + final Throwable[] t = new Throwable[1]; + final Object[] r = new Object[1]; + + ClosureExecuterAction cea = hudson.getExtensionList(RootAction.class).get(ClosureExecuterAction.class); + UUID id = UUID.randomUUID(); + cea.add(id,new Runnable() { + public void run() { + try { + r[0] = c.call(); + } catch (Throwable e) { + t[0] = e; + } + } + }); + createWebClient().goTo("closures/?uuid="+id); + + if (t[0]!=null) + throw t[0]; + return r[0]; + } + /** * Sometimes a part of a test case may ends up creeping into the serialization tree of {@link Saveable#save()}, * so detect that and flag that as an error. diff --git a/war/pom.xml b/war/pom.xml index ad5a949333..d9ad41039c 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.321-SNAPSHOT + 1.322-SNAPSHOT ../pom.xml @@ -112,7 +112,7 @@ THE SOFTWARE. - +