JsUnit |
Maven 2 is a build tool from the Apache Software Foundation generally used for Java development. It uses a Project Object Model defined in a pom.xml file to describe the build. Maven 2 uses a lifecycle where at each phase of this lifecycle different goals can be attached that are provided by plugins. The JsUnit plugin is automatically attached to the test test phase.
The JsUnit plugin uses Rhino to perform the JavaScript tests.
The artifacts of JsUnit and its plugin is located in the Maven 2 repository at BerliOS. The released versions will also be available at Maven's central repository, but the upload procedure may cause some time gap. The reports generated by Maven are also available.
The JsUnit Maven plugin has simply to be declared in the build section with the other plugins. As usual with Maven 2 all necessary dependencies are automatically available. The plugin itself is published with groupId de.berlios.jsunit and artifactDi jsunit-maven2-plugin in the Maven repository of JsUnit at BerliOS and in Maven's central repository also.
The configuration section of the plugin has following elements:
Name | Description | Default |
printSummary | A flag to enable a summary for the performed unit tests. | ${maven.test.skip} |
reportsDirectory | The directory where the plugin writes the results of the unit tests. | ${project.build.directory}/surefire-reports |
skip | A flag to skip the JavaScript unit tests completely. | ${maven.test.skip} |
skipExec | A flag to skip the execution of the JavaScript unit tests, but the JavaScript code is still loaded into the JavaScript engine to detect possible syntax problems. | ${maven.test.skip.exec} |
sourceDirectory | The root directory for the JavaScript sources. All source declarations are relative to this setting. | ${basedir}/src/main/webapp/js |
sources | An array of source elements. Each element contains a name to a JavaScript source file (relative to the path given in sourceDirectory). The sequence of the source elements define the sequence the files are loaded into the JavaScript engine. | ${basedir}/src/main/webapp/js |
testFailureIgnore | A flag to allow the current build to continue ignoring possible test failures. | ${maven.test.failure.ignore} |
testSourceDirectory | The root directory for the JavaScript unit test sources. All include declarations in a testSuite are relative to this setting. | ${basedir}/src/test/js |
testSuites | An array of testSuite elements. |
A testSuite contains following elements:
Name | Description | Default |
includes | An array of include elements. Each element defines a file pattern with a name relative to the testSourceDirectory element. | |
name | The name of the test suite. | |
type | The type of the test suite, one of the following values:
| TESTCASES |
The following JsUnit plugin declaration is used in the POM file of the samples directory.
JsUnit © 1999, 2000, 2001, 2002, 2003, 2006, 2007 by Jörg Schaible
|
Generated on Wed Apr 15 2015 02:33:06 for JsUnit by doxygen 1.8.5
|