Run integration tests using Surefire. This goal was copied from Maven's surefire plugin to accomodate a few things for the NAR plugin: 1. To test a jar file with its native module we can only run after the package phase, so we use the integration-test phase. 2. We need to set java.library.path to an AOL (architecture-os-linker) specific value, but AOL is only known in the NAR plugin and thus cannot be set from the pom. 3. To have the java.library.path definition picked up by java we need the "pertest" forkmode. To use this goal you need to put the test sources in the regular test directories but disable the running of the tests by the maven-surefire-plugin.
Mojo Attributes:
test
integration-test
Name | Type | Description |
---|---|---|
architecture | String |
The Architecture for the nar, Some choices are: "x86", "i386", "amd64", "ppc", "sparc", ... Defaults to a derived value from ${os.arch} |
basedir | File |
The base directory of the project being tested. This can be obtained in your unit test by System.getProperty("basedir"). |
failOnError | boolean |
Fail on compilation/linking error. Default value is true . |
libtool | boolean |
Set use of libtool. If set to true, the "libtool " will be prepended to the command line for compatible processors. Default value is false . |
runtime | String |
Sets the type of runtime library, possible values "dynamic", "static". Default value is dynamic . |
testClassesDirectory | File |
The directory containing generated test classes of the project being tested. |
testSourceDirectory | File |
The test source directory containing test class sources. |
Name | Type | Description |
---|---|---|
aol | String |
Architecture-OS-Linker name. Defaults to: arch-os-linker. |
argLine | String |
Arbitrary options to set on the command line. |
artifactFactory | ArtifactFactory |
Creates the artifact |
artifactResolver | ArtifactResolver |
Resolves the artifacts needed. |
c | C |
C Compiler |
childDelegation | boolean |
When false it makes tests run using the standard classloader delegation
instead of the default Maven isolated classloader. Only used when forking
(forkMode is not "none"). Setting it to false helps with some problems caused by conflicts between xml parsers in the classpath and the Java 5 provider parser. Default value is false . |
cpp | Cpp |
C++ Compiler |
disableXmlReport | boolean |
Flag to disable the generation of report files in xml format. Default value is false . |
environmentVariables | Map |
Additional environments to set on the command line. |
excludedGroups | String |
Excluded groups. Any methods/classes/etc with one of the groups specified in this list will specifically not be run. |
excludes | List |
List of patterns (separated by commas) used to specify the tests that
should be excluded in testing. When not specified and when the
test parameter is not specified, the default excludes will
be
**/Abstract*Test.java **/Abstract*TestCase.java **/*$* |
forkMode | String |
Option to specify the forking mode. Can be "never", "once" or "always".
"none" and "pertest" are also accepted for backwards compatibility. Default value is once . |
fortran | Fortran |
Fortran Compiler |
groups | String |
Groups for this test. Only classes/methods/etc decorated with one of the groups specified here will be included in test run, if specified. |
includes | List |
List of patterns (separated by commas) used to specify the tests that
should be included in testing. When not specified and when the
test parameter is not specified, the default includes will
be
**/Test*.java **/*Test.java **/*TestCase.java |
java | Java |
Java info for includes and linking |
javah | Javah |
Javah info |
jvm | String |
Option to specify the jvm (or path to the java executable) to use with the forking options. For the default, the jvm will be the same as the one used to run Maven. |
libraries | List |
List of libraries to create |
linker | Linker |
Linker |
maxCores | int |
Maximum number of Cores/CPU's to use. 0 means unlimited. |
metadataSource | ArtifactMetadataSource |
For retrieval of artifact's metadata. |
os | String |
The Operating System for the nar. Some choices are: "Windows", "Linux", "MacOSX", "SunOS", ... Defaults to a derived value from ${os.name} FIXME table missing |
output | String |
Name of the output |
parallel | boolean |
When you use the parallel attribute, TestNG will try to run all your test
methods in separate threads, except for methods that depend on each
other, which will be run in the same thread in order to respect their
order of execution. Default value is false . |
printSummary | boolean |
Option to print summary of test suites or just print the test cases that
has errors. Default value is true . |
redirectTestOutputToFile | boolean |
When forking, set this to true to redirect the unit test standard output
to a file (found in reportsDirectory/testName-output.txt). Default value is false . |
remoteRepositories | List |
The plugin remote repositories declared in the pom. |
reportFormat | String |
Selects the formatting for the test report to be generated. Can be set as
brief or plain. Default value is brief . |
reportsDirectory | File |
Base directory where all reports are written to. |
skip | boolean |
Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion. |
skipExec | boolean |
Set this to 'true' to bypass unit tests execution, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion. |
skipNAR | boolean |
Skip running of NAR plugins (any) altogether. Default value is false . |
suiteXmlFiles | File[] |
List of TestNG suite xml file locations, seperated by commas. It should be noted that if suiteXmlFiles is specified, no other tests will be run, ignoring other parameters, like includes and excludes. |
systemProperties | Properties |
List of System properties to pass to the JUnit tests. |
targetDirectory | File |
Target directory for Nar file construction Defaults to "${project.build.directory}/nar" for "nar-compile" goal Defaults to "${project.build.directory}/test-nar" for "nar-testCompile" goal |
test | String |
Specify this parameter(can be a comma separated list) if you want to use
the test pattern matching notation, Ant pattern matching, to select tests
to run. The Ant pattern will be used to create an include pattern
formatted like **/${test}.java When used, the
includes and excludes patterns parameters
are ignored. |
testFailureIgnore | boolean |
Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion. |
tests | List |
List of tests to create |
threadCount | int |
The attribute thread-count allows you to specify how many threads should
be allocated for this execution. Only makes sense to use in conjunction
with parallel. Default value is 5 . |
trimStackTrace | boolean |
Whether to trim the stack trace in the reports to just the lines within
the test, or show the full trace. Default value is true . |
useFile | boolean |
Option to generate a file test report or just output the test report to
the console. Default value is true . |
useSystemClassLoader | boolean |
Option to pass dependencies to the system's classloader instead of using
an isolated class loader when forking. Prevents problems with JDKs which
implement the service provider lookup mechanism by using the system's
classloader. Default value is false . |
workingDirectory | File |
Command line working directory. |
java.lang.String
No
java.lang.String
Yes
${os.arch}
java.lang.String
No
${argLine}
org.apache.maven.artifact.factory.ArtifactFactory
No
org.apache.maven.artifact.resolver.ArtifactResolver
No
java.io.File
Yes
${basedir}
org.freehep.maven.nar.C
No
boolean
No
${childDelegation}
false
org.freehep.maven.nar.Cpp
No
boolean
No
${disableXmlReport}
false
java.util.Map
No
java.lang.String
No
${excludedGroups}
test
parameter is not specified, the default excludes will
be
**/Abstract*Test.java **/Abstract*TestCase.java **/*$*
java.util.List
No
boolean
Yes
true
java.lang.String
No
${forkMode}
once
org.freehep.maven.nar.Fortran
No
java.lang.String
No
${groups}
test
parameter is not specified, the default includes will
be
**/Test*.java **/*Test.java **/*TestCase.java
java.util.List
No
org.freehep.maven.nar.Java
No
org.freehep.maven.nar.Javah
No
java.lang.String
No
${jvm}
java.util.List
No
boolean
Yes
false
org.freehep.maven.nar.Linker
No
int
No
org.apache.maven.artifact.metadata.ArtifactMetadataSource
No
java.lang.String
No
java.lang.String
No
${project.artifactId}-${project.version}
boolean
No
${parallel}
false
boolean
No
${surefire.printSummary}
true
boolean
No
${maven.test.redirectTestOutputToFile}
false
java.util.List
No
${project.pluginArtifactRepositories}
java.lang.String
No
${surefire.reportFormat}
brief
java.io.File
No
${project.build.directory}/surefire-reports
java.lang.String
Yes
dynamic
boolean
No
${maven.test.skip}
boolean
No
${maven.test.skip.exec}
boolean
No
${nar.skip}
false
java.io.File[]
No
java.util.Properties
No
java.io.File
No
**/${test}.java
When used, the
includes
and excludes
patterns parameters
are ignored.
java.lang.String
No
${test}
java.io.File
Yes
${project.build.testOutputDirectory}
boolean
No
${maven.test.failure.ignore}
java.io.File
Yes
${project.build.testSourceDirectory}
java.util.List
No
int
No
${threadCount}
5
boolean
No
${trimStackTrace}
true
boolean
No
${surefire.useFile}
true
boolean
No
${surefire.useSystemClassLoader}
false
java.io.File
No