- Use the ui-samples plugin for a test bed of automated test injection to plugins.

- Inject cursory Jelly checks to the plugin build.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@30336 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2010-04-22 22:39:48 +00:00
1 parent fd8e6429b7
commit 35ab73dc3c
2 files changed
+27 -3

No files matched your search

@@ -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<String,?> params) {
return new TestSuite();
public static TestSuite build(Map<String,?> 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);
}
}