From: <jbo...@li...> - 2006-05-24 14:30:40
|
Author: rl...@jb... Date: 2006-05-24 10:30:17 -0400 (Wed, 24 May 2006) New Revision: 4404 Modified: labs/jbossbuild/trunk/projects/maven-plugins/maven-jrunit-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java Log: add jdbc params Modified: labs/jbossbuild/trunk/projects/maven-plugins/maven-jrunit-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java =================================================================== --- labs/jbossbuild/trunk/projects/maven-plugins/maven-jrunit-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java 2006-05-24 14:04:56 UTC (rev 4403) +++ labs/jbossbuild/trunk/projects/maven-plugins/maven-jrunit-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java 2006-05-24 14:30:17 UTC (rev 4404) @@ -59,7 +59,7 @@ import java.util.Properties; /** - * Run tests using Surefire. + * Run tests using Surefire. This is a fork which allows us to run jrunit style tests * * @author Jason van Zyl * @version $Id: SurefirePlugin.java 406180 2006-05-14 01:40:09Z brett $ @@ -70,6 +70,42 @@ public class SurefirePlugin extends AbstractMojo { + + /** + * The directory of for the file benchmark receiver + * + * @parameter expression="${fileReceiverDir}" + */ + private String fileReceiverDir; + + /** + * The classname of the driver to use + * + * @parameter expression="${jdbcDriverClass}" + */ + private String jdbcDriverClass; + + /** + * The URL of the driver to use + * + * @parameter expression="${jdbcDriverURL}" + */ + private String jdbcDriverUrl; + + /** + * The user of the driver to use + * + * @parameter expression="${jdbcDriverUser}" + */ + private String jdbcDriverUser; + + /** + * The classname of the driver to use + * + * @parameter expression="${jdbcDriverPassword}" + */ + private String jdbcDriverPassword; + /** * Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion. * @@ -352,28 +388,29 @@ public void execute() throws MojoExecutionException, MojoFailureException { - this.getLog().info("JBOSS FORK HACK"); - this.getLog().info("Setting up JRUNIT"); + this.getLog().info("Executing JRunit Test Plugin"); + this.getLog().info("Creating a new benchmark receiver"); org.jboss.jrunit.controller.ant.AntBenchmarkReceiver receiver = new AntBenchmarkReceiver(); + AntQuitBenchmark quit = new AntQuitBenchmark(); + + this.getLog().info("Creating a new database receiver"); AntDatabaseBenchmarkReceiver dbReceiver = new AntDatabaseBenchmarkReceiver(); - dbReceiver.setJdbcClass(null); - dbReceiver.setJdbcPassword(null); - dbReceiver.setJdbcURL(null); - dbReceiver.setJdbcUserName(null); - dbReceiver.setOnlyIf(null); + dbReceiver.setJdbcClass(jdbcDriverClass); + dbReceiver.setJdbcPassword(jdbcDriverPassword); + dbReceiver.setJdbcURL(jdbcDriverUrl); + dbReceiver.setJdbcUserName(jdbcDriverUser); + dbReceiver.setOnlyIf(jdbcDriverClass); + + this.getLog().info("Creating a File Benchmark Receiver receiver"); AntFileBenchmarkReceiver fileBenchMarkReceiver = new AntFileBenchmarkReceiver(); - fileBenchMarkReceiver.setDirectory("./build"); + fileBenchMarkReceiver.setDirectory(fileReceiverDir); + receiver.getReceivers().add(dbReceiver); receiver.getReceivers().add(fileBenchMarkReceiver); - - - - - - + if ( skip ) { getLog().info( "Tests are skipped." ); @@ -784,4 +821,76 @@ surefireBooter.addReport( XMLReporter.class.getName(), new Object[]{reportsDirectory, trimStackTrace} ); } } + /** + * Get the jdbcDriverClass. + * + * @return the jdbcDriverClass. + */ + public String getJdbcDriverClass() + { + return jdbcDriverClass; + } + /** + * Set the jdbcDriverClass. + * + * @param jdbcDriverClass The jdbcDriverClass to set. + */ + public void setJdbcDriverClass(String jdbcDriverClass) + { + this.jdbcDriverClass = jdbcDriverClass; + } + /** + * Get the jdbcDriverPassword. + * + * @return the jdbcDriverPassword. + */ + public String getJdbcDriverPassword() + { + return jdbcDriverPassword; + } + /** + * Set the jdbcDriverPassword. + * + * @param jdbcDriverPassword The jdbcDriverPassword to set. + */ + public void setJdbcDriverPassword(String jdbcDriverPassword) + { + this.jdbcDriverPassword = jdbcDriverPassword; + } + /** + * Get the jdbcDriverUrl. + * + * @return the jdbcDriverUrl. + */ + public String getJdbcDriverUrl() + { + return jdbcDriverUrl; + } + /** + * Set the jdbcDriverUrl. + * + * @param jdbcDriverUrl The jdbcDriverUrl to set. + */ + public void setJdbcDriverUrl(String jdbcDriverUrl) + { + this.jdbcDriverUrl = jdbcDriverUrl; + } + /** + * Get the jdbcDriverUser. + * + * @return the jdbcDriverUser. + */ + public String getJdbcDriverUser() + { + return jdbcDriverUser; + } + /** + * Set the jdbcDriverUser. + * + * @param jdbcDriverUser The jdbcDriverUser to set. + */ + public void setJdbcDriverUser(String jdbcDriverUser) + { + this.jdbcDriverUser = jdbcDriverUser; + } } |