MyFaces uses the testing tools in the build process. Tools like JUnit, Selenium and HostedQA used via Maven plugins.
JUnit is used via the Maven Surefire plugin during the testing phase of the build process. Source code for unit test are usually located in the src/test directory of each project.
Selenium from OpenQA is a testing tool that is run in an browser. Among other thing, it is used to test navigation and the HTML generated by MyFaces. Please refer to Tomahawk's testing section on the MyFaces website for more information on how Selenium is used and configured.
Adding the following to ~/.m2/settings.xml will eliminate the need to include -Dcargo.tomcat5x.home=/path/to/tomcat5 on the command line to when deploying Cargo and running the test server.
<profile> <id>selenium</id> <properties> <cargo.tomcat5x.home>/path/to/tomcat5</cargo.tomcat5x.home> </properties> </profile>
HostedQA is a web-based quality assurance solution from Autoriginate. Please refer to Tomahawk's testing section on the !MyFaces website for more information on how HostedQA is used and configured. (Note: The former websites for Autoriginate and HostedQA have been hijacked by non-related entities and have been removed. Consider looking for more information on Patrick Lightbody’s personal blog.)
The HostedQA Client v1.6.2 and 1.7 requires Java 1.5. Running Java 1.4 will cause the following an Unsupported major.minor version error
Running with Sun's RI
Tomahawk's example can run using Sun's reference implementation (RI). To this, simply add -Djsf=ri to the maven command line.
As an example, to build and run simple example using the Sun RI issue the following command from tomahawk/examples/simple directory.
mvn clean package cargo:start -P selenium -Djsf=ri
You can this point the browser to the following URL to run the Selenium test suite: