public class TestMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected String |
argLine
Arbitrary JVM options to set on the command line.
|
protected List<String> |
classpathElements
The classpath elements of the project being tested.
|
protected int |
concurrency
Number of concurrent executions.
|
protected String |
debugForkedProcess
Attach a debugger to the forked JVM.
|
protected boolean |
fork
Option to specify the forking behavior.
|
protected org.apache.maven.project.MavenProject |
project |
protected boolean |
quiet
If true, the stdout/stderr from tests will not be copied to the console.
|
protected boolean |
skipTests
Set this to 'true' to skip running tests, but still compile them.
|
protected Properties |
systemProperties
List of System properties to pass to the JUnit tests.
|
protected String |
test
Specify this parameter to run individual tests by file name, overriding the
includes/excludes
parameters. |
protected boolean |
testFailureIgnore
Set this to true to ignore a failure during testing.
|
| Constructor and Description |
|---|
TestMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected LocalTestCaseRunner |
createTestCaseRunner() |
void |
execute() |
void |
executeForked()
Executes tests in several child JVMs concurrently.
|
void |
executeLocal() |
hudson.remoting.Channel |
fork(OutputStream output,
ExecutorService executors)
Forks a new JVM and pumps its output to the given
OutputStream |
protected org.apache.maven.project.MavenProject project
protected List<String> classpathElements
protected boolean testFailureIgnore
protected boolean fork
protected int concurrency
protected String debugForkedProcess
protected String test
includes/excludes
parameters. Each pattern you specify here will be used to create an
include pattern formatted like **/${test}.java, so you can just type "-Dtest=MyTest"
to run a single test called "foo/MyTest.java". This parameter will override the TestNG suiteXmlFiles
parameter.
since 1.7 you can now use "-Dtest=MyTest#method" to execute only one method of the unit tests.
Note * is supported too "-Dtest=MyTest#method*" to execute only method starting with methodprotected boolean quiet
protected String argLine
protected Properties systemProperties
protected boolean skipTests
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic void executeLocal()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected LocalTestCaseRunner createTestCaseRunner()
public void executeForked()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic hudson.remoting.Channel fork(OutputStream output, ExecutorService executors) throws IOException
OutputStreamoutput - The stream will be closed upon the completion of the process.executors - Executes the remote requests.IOExceptionCopyright © 2013. All Rights Reserved.