diff --git a/test/src/main/java/org/jvnet/hudson/test/PluginAutomaticTestBuilder.java b/test/src/main/java/org/jvnet/hudson/test/PluginAutomaticTestBuilder.java index ac44710514..9c9eee02a2 100644 --- a/test/src/main/java/org/jvnet/hudson/test/PluginAutomaticTestBuilder.java +++ b/test/src/main/java/org/jvnet/hudson/test/PluginAutomaticTestBuilder.java @@ -25,6 +25,7 @@ package org.jvnet.hudson.test; import junit.framework.TestSuite; +import java.io.File; import java.util.Map; /** @@ -43,7 +44,23 @@ public class PluginAutomaticTestBuilder { * outputDirectory (String) : target/classes dir where class files and resources can be found * testOutputDirectory (String) : target/test-classes. */ - public static TestSuite build(Map params) { - return new TestSuite(); + public static TestSuite build(Map params) throws Exception { + TestSuite suite = new TestSuite(); + + // automatic Jelly tests + if (params.containsKey("outputDirectory") // shouldn't happen, but be defensive + || notSkipTests("JellyTest")) { + File outputDirectory = new File((String)params.get("outputDirectory")); + suite.addTest(JellyTestSuiteBuilder.build(outputDirectory)); + } + + return suite; + } + + /** + * Provides an escape hatch for plugin developers to skip auto-generated tests. + */ + private static boolean notSkipTests(String propertyName) { + return !Boolean.getBoolean("hpiTest.skip"+propertyName); } } diff --git a/ui-samples-plugin/pom.xml b/ui-samples-plugin/pom.xml index 78426c4b3d..b99c9f3595 100644 --- a/ui-samples-plugin/pom.xml +++ b/ui-samples-plugin/pom.xml @@ -41,6 +41,13 @@ THE SOFTWARE. ${project.version} provided + + + org.jvnet.hudson.main + hudson-test-harness + ${project.version} + test + javax.servlet servlet-api @@ -68,7 +75,7 @@ THE SOFTWARE. org.jvnet.hudson.tools maven-hpi-plugin - 1.43 + 1.51 true true