From 242e682e6209fc9adaaf05bde2d382e62b67f33b Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Tue, 29 May 2012 11:17:23 -0700 Subject: [PATCH] improved error diagnostics --- .../main/java/org/jvnet/hudson/test/TestPluginManager.java | 5 ++++- test/src/main/java/org/jvnet/hudson/test/WarExploder.java | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/src/main/java/org/jvnet/hudson/test/TestPluginManager.java b/test/src/main/java/org/jvnet/hudson/test/TestPluginManager.java index 1978bcec44..c3aab7f640 100644 --- a/test/src/main/java/org/jvnet/hudson/test/TestPluginManager.java +++ b/test/src/main/java/org/jvnet/hudson/test/TestPluginManager.java @@ -64,7 +64,10 @@ public class TestPluginManager extends PluginManager { protected Collection loadBundledPlugins() throws Exception { Set names = new HashSet(); - File[] children = new File(WarExploder.getExplodedDir(),"WEB-INF/plugins").listFiles(); + File bundledPlugins = new File(WarExploder.getExplodedDir(), "WEB-INF/plugins"); + File[] children = bundledPlugins.listFiles(); + if (children==null) + throw new Error("Unable to find "+bundledPlugins); for (File child : children) { try { names.add(child.getName()); diff --git a/test/src/main/java/org/jvnet/hudson/test/WarExploder.java b/test/src/main/java/org/jvnet/hudson/test/WarExploder.java index 6531553c5d..5ce785277d 100644 --- a/test/src/main/java/org/jvnet/hudson/test/WarExploder.java +++ b/test/src/main/java/org/jvnet/hudson/test/WarExploder.java @@ -80,11 +80,11 @@ final class WarExploder { } } - // locate hudson.war + // locate jenkins.war URL winstone = WarExploder.class.getResource("/winstone.jar"); if(winstone==null) - // impossible, since the test harness pulls in hudson.war - throw new AssertionError("jenkins.war is not in the classpath."); + // impossible, since the test harness pulls in jenkins.war + throw new AssertionError("jenkins.war is not in the classpath. If you are running this from the core workspace, run 'mvn install' to create the war image in war/target/jenkins"); File war = Which.jarFile(Class.forName("executable.Executable")); File explodeDir = new File("./target/jenkins-for-test").getAbsoluteFile();