JsUnit 1.3 |
![]() |
![]() |
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 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 |
<plugin> <groupId>de.berlios.jsunit</groupId> <artifactId>jsunit-maven2-plugin</artifactId> <executions> <execution> <id>test</id> <configuration> <sourceDirectory>.</sourceDirectory> <sources> <source>money/IMoney.js</source> <source>money/Money.js</source> <source>money/MoneyBag.js</source> </sources> <testSourceDirectory>.</testSourceDirectory> <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory> <testSuites> <testSuite> <name>SampleSuite</name> <type>TESTCASES</type> <includes> <include>money/*.js</include> </includes> </testSuite> </testSuites> </configuration> <goals> <goal>jsunit-test</goal> </goals> </execution> </executions> </plugin>
JsUnit © 1999, 2000, 2001, 2002, 2003, 2006, 2007 by Jörg Schaible
|
Generated on Fri Oct 19 23:10:41 2007 for JsUnit by doxygen 1.5.2
|