Unit test plugin; runs junit test cases and generates a test report. More...
| Release-level Ant targets: | |
|---|---|
| junit |
Iterates across all modules part of this release, and runs the "junit" target of each module.
This results in a JUnit report for each individual module, and one for the whole
release (see the "junit-report" target).
Events fired: junit-pre, junit-post.
|
| junit-report |
Generate release-level junit report based on previously run tests.
This happens automatically if you run the release-level "junit" target.
Events fired: junit-report-pre, junit-report-post.
|
| Module-level Ant targets: | |
|---|---|
| junit |
Runs the JUnit tests which are part of this module.
Events fired: junit-pre, junit-post.
|
| junit-compile |
Compile the TestCases and TestSuites in the ${antmod.junit.src}
directory.
Events intercepted: javac-post.
|
| Configurable properties: [...] | |
|---|---|
| antmod.junit.fork | Run each test in a separate VM. When using Java 1.4, it may be necessary to fork the JUnit tests to prevent XML parser issues. Defaults to false. |
| antmod.junit.src | The directory containing the java source files for the JUnit tests. Defaults to src/junit. |
| antmod.junit.dest | The directory where the compiled JUnit test classes should be written to. Defaults to ${antmod.module.dirs.build}/junitclasses. |
| antmod.junit.includes | Comma- or space-separated list of patterns of java source files that must be included in the JUnit batch test. Defaults to **/*Test*.java. |
| antmod.junit.excludes | Comma- or space-separated list of patterns of java source files that must be excluded from the JUnit batch test. Defaults to **/AllTests.java. |
| antmod.junit.report.module.dir | Specifies the directory where the JUnit test result report for a module is written. This report is both in HTML and XML format. Defaults to ${antmod.module.dirs.build}/junitreport. |
| antmod.junit.report.release.dir | Specifies the directory where the JUnit test result report for the release is written. This report is both in HTML and XML format. Defaults to ${antmod.release.dirs.build}/junitreport. |
| antmod.junit.report.format | The format of the generated report. Must be "noframes" or "frames". Defaults to frames. |
| antmod.junit.haltonfailure | Stop the build process if a test fails (errors are considered failures as well). Defaults to true. |
| antmod.junit.class.path | Extends the classpath used for running the JUnit tests. Is a colon- or semicolon-separated lists of file paths. Defaults to empty. |
| antmod.junit.output.format |
Specifies the format of the output on the console. Can be "brief", "plain" or "xml".
With "brief" only detailed information for testcases that failed is printed,
while "plain" gives a small statistics line for all test cases.
Defaults to plain.
|
This plugin runs TestCases using the JUnit testing framework. It normally runs all JUnit test classes it can find in the modules of the release, and generates a nice HTML formatted report.
The Antmod JUnit Plugin uses the optional JUnit Ant task for doing this.
This requires junit.jar to be in lib directory of Ant: ${ANT_HOME}/lib.