diff --git a/surefire/.cvsignore b/surefire/.cvsignore
new file mode 100644
index 00000000..8eeb0ff8
--- /dev/null
+++ b/surefire/.cvsignore
@@ -0,0 +1,7 @@
+target
+velocity.log
+maven.log
+.classpath
+.project
+*.ipr
+*.iws
diff --git a/surefire/plugin.jelly b/surefire/plugin.jelly
new file mode 100644
index 00000000..35396f4f
--- /dev/null
+++ b/surefire/plugin.jelly
@@ -0,0 +1,181 @@
+
+
+
+ * java junit.textui.TestRunner [-wait] TestCaseClass + *+ * TestRunner expects the name of a TestCase class as argument. + * If this class defines a static
suite method it
+ * will be invoked and the returned test is run. Otherwise all
+ * the methods starting with "test" having no arguments are run.
+ * + * When the wait command line argument is given TestRunner + * waits until the users types RETURN. + *
+ * TestRunner prints a trace as the tests are executed followed by a
+ * summary at the end.
+ */
+public class TestRunnerBooter
+{
+ private Project project;
+
+ public void setProject( Project project )
+ {
+ this.project = project;
+ }
+
+ public void execute()
+ throws Exception
+ {
+ // maven.build.dest
+ // maven.test.dest
+ // maven.build.dest
+ // maven.test.dest
+
+ IsolatedClassLoader classLoader = new IsolatedClassLoader();
+
+ File basedir = project.getFile().getParentFile();
+
+ System.setProperty( "basedir", basedir.getPath() );
+
+ Thread.currentThread().setContextClassLoader( classLoader );
+
+ classLoader.addURL( new File ( "/home/jvanzyl/maven-repo-local/junit/jars/junit-3.8.1.jar" ).toURL() );
+
+ classLoader.addURL( new File ( "/tmp/test-runner-1.4.jar" ).toURL() );
+
+ classLoader.addURL( new File( basedir, "target/classes/" ).toURL() );
+
+ classLoader.addURL( new File( basedir, "target/test-classes/" ).toURL() );
+
+ processDependencies( project, classLoader );
+
+ Class testRunnerClass = classLoader.loadClass( "org.apache.maven.test.TestRunner" );
+
+ Object testRunner = testRunnerClass.newInstance();
+
+ Method m = testRunnerClass.getMethod( "runTestClasses", new Class[] {
+ File.class,
+ List.class,
+ List.class,
+ ClassLoader.class } );
+
+ m.invoke( testRunner, new Object[]{
+ basedir,
+ project.getBuild().getUnitTest().getIncludes(),
+ project.getBuild().getUnitTest().getExcludes(),
+ classLoader,
+ } );
+ }
+
+ // We need to deal with populating a plugin classloader with its requirements.
+ private void processDependencies( Project project, IsolatedClassLoader classLoader )
+ throws MalformedURLException
+ {
+ if ( project.getArtifacts() == null )
+ {
+ return;
+ }
+
+ for ( Iterator i = project.getArtifacts().iterator(); i.hasNext(); )
+ {
+ Artifact artifact = (Artifact) i.next();
+
+ Dependency dependency = artifact.getDependency();
+
+ // Only add compile type dependencies to classloader
+ if ( dependency.getType().equals( "jar" ) )
+ {
+ // We have the jar and the classloader to push it into so
+ // lets do it!
+ if ( artifact.exists() )
+ {
+ classLoader.addURL( artifact.getFile().toURL() );
+ }
+ }
+ }
+ }
+}
diff --git a/surefire/src/surefire-runner/.cvsignore b/surefire/src/surefire-runner/.cvsignore
new file mode 100644
index 00000000..7244964b
--- /dev/null
+++ b/surefire/src/surefire-runner/.cvsignore
@@ -0,0 +1,5 @@
+target
+velocity.log
+maven.log
+.classpath
+.project
diff --git a/surefire/src/surefire-runner/project.xml b/surefire/src/surefire-runner/project.xml
new file mode 100644
index 00000000..991bc4f6
--- /dev/null
+++ b/surefire/src/surefire-runner/project.xml
@@ -0,0 +1,30 @@
+
+
+TestSuite is a Composite of Tests.
+ * It runs a collection of test cases. Here is an example using
+ * the dynamic test definition.
+ *
+ * TestSuite suite= new TestSuite();
+ * suite.addTest(new MathTest("testAdd"));
+ * suite.addTest(new MathTest("testDivideByZero"));
+ *
+ * Alternatively, a TestSuite can extract the tests to be run automatically.
+ * To do so you pass the class of your TestCase class to the
+ * TestSuite constructor.
+ * + * TestSuite suite= new TestSuite(MathTest.class); + *+ * This constructor creates a suite with all the methods + * starting with "test" that take no arguments. + * + * @see junit.framework.Test + */ +public class MavenJUnitTestSuite + implements Test +{ + private Vector fTests = new Vector( 10 ); + + private String fName; + + private Class junitTest = null; + + private Class testResultClass = null; + + /** + * Constructs an empty TestSuite. + */ + public MavenJUnitTestSuite() + { + } + + /** + * Constructs a TestSuite from the given class with the given name. + */ + public MavenJUnitTestSuite( Class theClass ) + { + this( theClass, ClassLoader.getSystemClassLoader() ); + } + + /** + * Constructs a TestSuite from the given class. Adds all the methods + * starting with "test" as test cases to the suite. + * Parts of this method was written at 2337 meters in the H�ffih�tte, + * Kanton Uri + */ + public MavenJUnitTestSuite( final Class theClass, ClassLoader classLoader ) + { + try + { + junitTest = classLoader.loadClass( "junit.framework.Test" ); + + testResultClass = classLoader.loadClass( "junit.framework.TestResult" ); + } + catch ( ClassNotFoundException e ) + { + } + + fName = theClass.getName(); + try + { + getTestConstructor( theClass ); // Avoid generating multiple error messages + } + catch ( NoSuchMethodException e ) + { + addTest( warning( "Class " + theClass.getName() + " has no public constructor TestCase(String name) or TestCase()" ) ); + return; + } + + if ( !Modifier.isPublic( theClass.getModifiers() ) ) + { + addTest( warning( "Class " + theClass.getName() + " is not public" ) ); + return; + } + + Class superClass = theClass; + Vector names = new Vector(); + + while ( junitTest.isAssignableFrom( superClass ) ) + { + Method[] methods = superClass.getDeclaredMethods(); + for ( int i = 0; i < methods.length; i++ ) + { + addTestMethod( methods[i], names, theClass ); + } + superClass = superClass.getSuperclass(); + } + + if ( fTests.size() == 0 ) + { + addTest( warning( "No tests found in " + theClass.getName() ) ); + } + } + + /** + * Constructs an empty TestSuite. + */ + public MavenJUnitTestSuite( String name ) + { + setName( name ); + } + + /** + * Adds a test to the suite. + */ + public void addTest( Object test ) + { + fTests.addElement( test ); + } + + /** + * Adds the tests from the given class to the suite + */ + public void addTestSuite( Class testClass ) + { + addTest( new MavenJUnitTestSuite( testClass ) ); + } + + private void addTestMethod( Method m, Vector names, Class theClass ) + { + String name = m.getName(); + + if ( names.contains( name ) ) + { + return; + } + + if ( !isPublicTestMethod( m ) ) + { + if ( isTestMethod( m ) ) + { + addTest( warning( "Test method isn't public: " + m.getName() ) ); + } + return; + } + + names.addElement( name ); + + addTest( createTest( theClass, name ) ); + } + + /** + * ...as the moon sets over the early morning Merlin, Oregon + * mountains, our intrepid adventurers type... + */ + static public Object createTest( Class theClass, String name ) + { + Constructor constructor; + + try + { + constructor = getTestConstructor( theClass ); + } + catch ( NoSuchMethodException e ) + { + return warning( "Class " + theClass.getName() + " has no public constructor TestCase(String name) or TestCase()" ); + } + Object test; + try + { + if ( constructor.getParameterTypes().length == 0 ) + { + test = constructor.newInstance( new Object[0] ); + + if ( test instanceof TestCase ) + { + ( (TestCase) test ).setName( name ); + } + } + else + { + test = constructor.newInstance( new Object[]{name} ); + } + } + catch ( InstantiationException e ) + { + return ( warning( "Cannot instantiate test case: " + name + " (" + exceptionToString( e ) + ")" ) ); + } + catch ( InvocationTargetException e ) + { + return ( warning( "Exception in constructor: " + name + " (" + exceptionToString( e.getTargetException() ) + ")" ) ); + } + catch ( IllegalAccessException e ) + { + return ( warning( "Cannot access test case: " + name + " (" + exceptionToString( e ) + ")" ) ); + } + + return test; + } + + /** + * Converts the stack trace into a string + */ + private static String exceptionToString( Throwable t ) + { + StringWriter stringWriter = new StringWriter(); + PrintWriter writer = new PrintWriter( stringWriter ); + t.printStackTrace( writer ); + return stringWriter.toString(); + + } + + /** + * Counts the number of test cases that will be run by this test. + */ + public int countTestCases() + { + int count = 0; + for ( Enumeration e = tests(); e.hasMoreElements(); ) + { + Test test = (Test) e.nextElement(); + count = count + test.countTestCases(); + } + return count; + } + + /** + * Gets a constructor which takes a single String as + * its argument or a no arg constructor. + */ + public static Constructor getTestConstructor( Class theClass ) + throws NoSuchMethodException + { + Class[] args = {String.class}; + + try + { + return theClass.getConstructor( args ); + } + catch ( NoSuchMethodException e ) + { + // fall through + } + return theClass.getConstructor( new Class[0] ); + } + + private boolean isPublicTestMethod( Method m ) + { + return isTestMethod( m ) && Modifier.isPublic( m.getModifiers() ); + } + + private boolean isTestMethod( Method m ) + { + String name = m.getName(); + Class[] parameters = m.getParameterTypes(); + Class returnType = m.getReturnType(); + return parameters.length == 0 && name.startsWith( "test" ) && returnType.equals( Void.TYPE ); + } + + /** + * Runs the tests and collects their result in a TestResult. + */ + public void run( TestResult result ) + { + for ( Enumeration e = tests(); e.hasMoreElements(); ) + { + if ( result.shouldStop() ) + { + break; + } + + Object test = e.nextElement(); + + runTest( test, result ); + } + } + + public void runTest( Object test, TestResult result ) + { + try + { + Method m = test.getClass().getMethod( "run", new Class[] { testResultClass } ); + + m.invoke( test, new Object[] { result } ); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + } + + /** + * Returns the test at the given index + */ + public Test testAt( int index ) + { + return (Test) fTests.elementAt( index ); + } + + /** + * Returns the number of tests in this suite + */ + public int testCount() + { + return fTests.size(); + } + + /** + * Returns the tests as an enumeration + */ + public Enumeration tests() + { + return fTests.elements(); + } + + /** + */ + public String toString() + { + if ( getName() != null ) + return getName(); + return super.toString(); + } + + /** + * Sets the name of the suite. + * @param name The name to set + */ + public void setName( String name ) + { + fName = name; + } + + /** + * Returns the name of the suite. Not all + * test suites have a name and this method + * can return null. + */ + public String getName() + { + return fName; + } + + /** + * Returns a test which will fail and log a warning message. + */ + private static Test warning( final String message ) + { + return new TestCase( "warning" ) + { + protected void runTest() + { + fail( message ); + } + }; + } +} diff --git a/surefire/src/surefire-runner/src/main/org/apache/maven/test/MavenTestSuiteLoader.java b/surefire/src/surefire-runner/src/main/org/apache/maven/test/MavenTestSuiteLoader.java new file mode 100644 index 00000000..b07d3983 --- /dev/null +++ b/surefire/src/surefire-runner/src/main/org/apache/maven/test/MavenTestSuiteLoader.java @@ -0,0 +1,33 @@ +package org.apache.maven.test; + +import junit.runner.TestSuiteLoader; + +/** + * + * + * @author Jason van Zyl + * + * @version $Id: MavenTestSuiteLoader.java,v 1.1 2004/01/09 16:23:01 jvanzyl Exp $ + */ +public class MavenTestSuiteLoader + implements TestSuiteLoader +{ + private ClassLoader classLoader; + + public MavenTestSuiteLoader( ClassLoader classLoader ) + { + this.classLoader = classLoader; + } + + public Class load( String className ) + throws ClassNotFoundException + { + return classLoader.loadClass( className ); + } + + public Class reload( Class clazz ) + throws ClassNotFoundException + { + return clazz; + } +} diff --git a/surefire/src/surefire-runner/src/main/org/apache/maven/test/ResultPrinter.java b/surefire/src/surefire-runner/src/main/org/apache/maven/test/ResultPrinter.java new file mode 100644 index 00000000..ad85f262 --- /dev/null +++ b/surefire/src/surefire-runner/src/main/org/apache/maven/test/ResultPrinter.java @@ -0,0 +1,143 @@ +package org.apache.maven.test; + +import java.io.PrintStream; +import java.text.NumberFormat; +import java.util.Enumeration; + +import junit.framework.AssertionFailedError; +import junit.framework.Test; +import junit.framework.TestFailure; +import junit.framework.TestListener; +import junit.framework.TestResult; +import junit.runner.BaseTestRunner; + +public class ResultPrinter implements TestListener +{ + PrintStream fWriter; + int fColumn = 0; + + public ResultPrinter( PrintStream writer ) + { + fWriter = writer; + } + + synchronized void print( TestResult result, long runTime, String testName ) + { + //printErrors( result ); + //printFailures( result ); + printFooter( result, runTime, testName ); + } + + protected void printErrors( TestResult result ) + { + printDefects( result.errors(), result.errorCount(), "error" ); + } + + protected void printFailures( TestResult result ) + { + printDefects( result.failures(), result.failureCount(), "failure" ); + } + + protected void printDefects( Enumeration booBoos, int count, String type ) + { + if ( count == 0 ) + { + return; + } + if ( count == 1 ) + { + getWriter().println( "There was " + count + " " + type + ":" ); + } + else + { + getWriter().println( "There were " + count + " " + type + "s:" ); + } + + for ( int i = 1; booBoos.hasMoreElements(); i++ ) + { + printDefect( (TestFailure) booBoos.nextElement(), i ); + } + } + + public void printDefect( TestFailure booBoo, int count ) + { // only public for testing purposes + printDefectHeader( booBoo, count ); + printDefectTrace( booBoo ); + } + + protected void printDefectHeader( TestFailure booBoo, int count ) + { + // I feel like making this a println, then adding a line giving the throwable a chance to print something + // before we get to the stack trace. + getWriter().print( count + ") " + booBoo.failedTest() ); + } + + protected void printDefectTrace( TestFailure booBoo ) + { + getWriter().print( BaseTestRunner.getFilteredTrace( booBoo.trace() ) ); + } + + protected void printFooter( TestResult result, long runtime, String testName ) + { + getWriter().println( " [funit] Running " + testName ); + + getWriter().println( " [funit] Tests run: " + result.runCount() + + ", Failures: " + result.failureCount() + + ", Errors: " + result.errorCount() + + ", Time elapsed: " + elapsedTimeAsString( runtime ) + " sec" ); + + printErrors( result ); + printFailures( result ); + } + + /** + * Returns the formatted string of the elapsed time. + * Duplicated from BaseTestRunner. Fix it. + */ + protected String elapsedTimeAsString( long runTime ) + { + return NumberFormat.getInstance().format( (double) runTime / 1000 ); + } + + public PrintStream getWriter() + { + return fWriter; + } + + /** + * @see junit.framework.TestListener#addError(Test, Throwable) + */ + public void addError( Test test, Throwable t ) + { + getWriter().print( "E" ); + } + + /** + * @see junit.framework.TestListener#addFailure(Test, AssertionFailedError) + */ + public void addFailure( Test test, AssertionFailedError t ) + { + getWriter().print( "F" ); + } + + /** + * @see junit.framework.TestListener#endTest(Test) + */ + public void endTest( Test test ) + { + } + + /** + * @see junit.framework.TestListener#startTest(Test) + */ + public void startTest( Test test ) + { + getWriter().print( "." ); + if ( fColumn++ >= 40 ) + { + getWriter().println(); + fColumn = 0; + } + } + +} diff --git a/surefire/src/surefire-runner/src/main/org/apache/maven/test/TestRunner.java b/surefire/src/surefire-runner/src/main/org/apache/maven/test/TestRunner.java new file mode 100644 index 00000000..08e48156 --- /dev/null +++ b/surefire/src/surefire-runner/src/main/org/apache/maven/test/TestRunner.java @@ -0,0 +1,215 @@ +package org.apache.maven.test; + +import junit.framework.Test; +import junit.framework.TestResult; +import junit.framework.TestSuite; +import junit.runner.BaseTestRunner; +import junit.runner.TestSuiteLoader; +import org.codehaus.plexus.util.DirectoryScanner; +import org.codehaus.plexus.util.StringUtils; + +import java.io.File; +import java.io.PrintStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Iterator; +import java.util.List; + +/** + * A command line based tool to run tests. + *
+ * java junit.textui.TestRunner [-wait] TestCaseClass + *+ * TestRunner expects the name of a TestCase class as argument. + * If this class defines a static
suite method it
+ * will be invoked and the returned test is run. Otherwise all
+ * the methods starting with "test" having no arguments are run.
+ * + * When the wait command line argument is given TestRunner + * waits until the users types RETURN. + *
+ * TestRunner prints a trace as the tests are executed followed by a
+ * summary at the end.
+ */
+public class TestRunner
+ extends BaseTestRunner
+{
+ private ResultPrinter resultPrinter;
+
+ public static final int SUCCESS_EXIT = 0;
+
+ public static final int FAILURE_EXIT = 1;
+
+ public static final int EXCEPTION_EXIT = 2;
+
+ private static final String FS = System.getProperty( "file.separator" );
+
+ public TestRunner()
+ {
+ this( System.out );
+ }
+
+ public TestRunner( PrintStream writer )
+ {
+ this( new ResultPrinter( writer ) );
+ }
+
+ public TestRunner( ResultPrinter printer )
+ {
+ resultPrinter = printer;
+ }
+
+ private ClassLoader classLoader;
+ private List includes;
+ private List excludes;
+ private File basedir;
+
+ public void runTestClasses( File basedir, List includes, List excludes, ClassLoader classLoader )
+ throws Exception
+ {
+ this.basedir = basedir;
+ this.includes = includes;
+ this.excludes = excludes;
+ this.classLoader = classLoader;
+
+ DirectoryScanner scanner = new DirectoryScanner();
+
+ scanner.setBasedir( new File( basedir, "target/test-classes" ) );
+
+ String[] incs = new String[includes.size()];
+
+ for ( int i = 0; i < incs.length; i++ )
+ {
+ incs[i] = StringUtils.replace( (String) includes.get( i ), "java", "class" );
+ }
+
+ scanner.setIncludes( incs );
+
+ String[] excls = new String[excludes.size() + 1];
+
+ for ( int i = 0; i < excls.length - 1; i++ )
+ {
+ excls[i] = StringUtils.replace( (String) excludes.get( i ), "java", "class" );
+ }
+
+ // Exclude inner classes
+
+ excls[excludes.size()] = "**/*$*";
+
+ scanner.setExcludes( excls );
+
+ scanner.scan();
+
+ String[] files = scanner.getIncludedFiles();
+
+ String s;
+
+ for ( int i = 0; i < files.length; i++ )
+ {
+ s = files[i];
+
+ s = s.substring( 0, s.indexOf( "." ) );
+
+ s = StringUtils.replace( s, FS, "." );
+
+ Class clazz = null;
+
+ try
+ {
+ clazz = classLoader.loadClass( s );
+ }
+ catch( ClassNotFoundException e )
+ {
+ System.out.println( "Can't find className = " + s );
+
+ continue;
+ }
+
+ TestResult result = run( clazz, s );
+
+ if ( result.errorCount() > 0 || result.failureCount() > 0 )
+ {
+ failures = "true";
+ }
+ }
+ }
+
+ private String failures = "false";
+
+ public String failures()
+ {
+ return failures;
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ public TestResult run( Class testClass, String testName )
+ {
+ return run( new TestSuite( testClass ), testName );
+
+ //return run( new MavenJUnitTestSuite( testClass, classLoader ), testName );
+ }
+
+ public TestResult run( Test test, String testName )
+ {
+ TestRunner runner = new TestRunner();
+
+ return runner.doRun( test, testName );
+ }
+
+ public TestSuiteLoader getLoader()
+ {
+ return new MavenTestSuiteLoader( classLoader );
+ }
+
+ public void testFailed( int status, Test test, Throwable t )
+ {
+ }
+
+ public void testStarted( String testName )
+ {
+ }
+
+ public void testEnded( String testName )
+ {
+ }
+
+ protected TestResult createTestResult()
+ {
+ return new TestResult();
+ }
+
+ public TestResult doRun( Test suite, String testName )
+ {
+ TestResult result = createTestResult();
+
+ long startTime = System.currentTimeMillis();
+
+ suite.run( result );
+
+ long endTime = System.currentTimeMillis();
+
+ long runTime = endTime - startTime;
+
+ resultPrinter.print( result, runTime, testName );
+
+ return result;
+ }
+
+ protected void runFailed( String message )
+ {
+ System.err.println( message );
+
+ System.exit( FAILURE_EXIT );
+ }
+
+ public void setPrinter( ResultPrinter printer )
+ {
+ resultPrinter = printer;
+ }
+
+
+}
diff --git a/surefire/src/surefire-runner/surefire-runner.ipr b/surefire/src/surefire-runner/surefire-runner.ipr
new file mode 100644
index 00000000..804db6b7
--- /dev/null
+++ b/surefire/src/surefire-runner/surefire-runner.ipr
@@ -0,0 +1,160 @@
+
+
+
+ This plug-in provides your basic JUnit testing facilities.
+
+ Provide source compatibility with a specific release
+
+ Corresponds to the
+
+
+ Property Optional? Description
+
+ maven.junit.fork
+ Yes
+
+ When using Java 1.4, it may be necessary to fork the JUnit
+ tests to prevent XML parser issues. The default value is
+
+ no.
+
+
+ maven.junit.dir
+ Yes
+
+ The directory to invoke the VM in. (ignored if fork is disabled).
+ The default value is
+ ${basedir}.
+
+
+ maven.junit.usefile
+ Yes
+
+ If this value is set to false, JUnit test run details will appear on
+ the console as the tests are executed. If not, they are stored in
+ a file in the
+ test-reports directory. The default value
+ is true.
+
+
+ maven.junit.printSummary
+ Yes
+
+ If this value is set to false, JUnit test run details will not
+ include test summary information for a suite. Default value is
+
+ true. This parameter corresponds to the JUnit Ant
+ task printSummary attribute.
+
+
+ maven.test.dest
+ Yes
+
+ Specifies the unit test classes directory. This is the
+ location where the java classes for the test source
+ code will be generated to. The default value is
+
+ ${maven.build.dir}/test-classes.
+
+
+ maven.test.skip
+ Yes
+
+ Set this to 'true' to bypass unit tests entirely. Its use
+ is NOT RECOMMENDED, but quite convenient on occasion.
+
+
+
+ maven.test.failure.ignore
+ Yes
+
+ Set this to any value to ignore a failure during testing.
+ Its use is NOT RECOMMENDED, but quite convenient on occasion.
+
+
+
+ maven.test.source
+ Yes
+
+
+ source attribute for the ant
+ javac
+ task.
+
+
+ maven.iutest.dest
+ Yes
+
+ Specifies the integration unit test classes directory.
+ This is the location where the java classes for the
+ integration unit test source code will be generated to.
+ The default value is
+
+ ${maven.build.dir}/iutest-classes.
+
+
+ maven.iutest.dir
+ Yes
+
+ Specifies the integration unit test source directory.
+ This property should never be overridden as the value is
+ determined directly from the project descriptor. The
+ default value is
+
+ ${maven.integrationUnitTestSourceDirectory}.
+
+
+ maven.out.test.dir
+ Yes
+
+ Specifies the directory where the integration unit testing
+ is run. The default value is
+ ${build.dir}/iutest.
+
+
+ maven.webapp.dir
+ Yes
+
+ Specifies the directory of the web application used to
+ perform integration unit testing. The default value is
+
+ ${iutest.dir}/testapp.
+
+
+ maven.conf.test.dir
+ Yes
+
+ Specifies the configuration directory used to build the
+ web application used for integration unit testing. The
+ default value is
+ ${iutest.dir}/cactus.
+
+
+ maven.tomcat.home
+ Yes
+
+ Specifies your local Tomcat installation directory.
+ The default value is
+ ${tdk.home}. If
+ ${tdk.home} is not specified in your
+ ${user.home}/build.properties, you should set
+ this property. This is used for the integration unit
+ testing.
+
+
+ maven.test.port
+ Yes
+
+ Specifies the port that Tomcat will use for integration
+ unit testing. The default value is
+ 8192.
+
+
+ maven.junit.jvmargs
+ Yes
+
+ If fork is enabled, additional parameters may be passed to the new VM.
+ You can specify some args separate by space.
+ Each arg is describe in sub properties.
+ Sample :
+
+
+
+ maven.junit.sysproperties
+ Yes
+
+ Use this property elements to specify system properties required
+ by the class. These properties will be made available to the VM during
+ the execution of the test (either Maven's VM or the forked VM, if fork is enabled).
+ You can specify system properties separate by space.
+ Each properties is describe in sub properties.
+ Sample :
+
+
+
+ maven.test.search.classdir
+ Yes
+
+ Use this property to specify that JUnit should search the test classes directory
+ rather than the source directory. This allows for test cases to be written in other
+ languages such as Groovy which generate bytecode that can then be used by this plugin.
+ Sample :
+
+