Building JSFUnit with Maven 2The JSFUnit project uses Maven 2 for its build. This document explains how to build JSFUnit Core, build the examples for your servlet container, and run the JSFUnit tests against the examples. First, you will need to checkout the source from SVN. |
Building JSFUnit and Examples
|
To build JSFUnit,you must use JDK 1.6. The source level and compilation target are both set to JDK 1.5. However, because of a bug in the JDK 1.5 compiler, you must use JDK 1.6 to compile. JSFUnit runs on any servlet platform that supports JSF 1.1, JSF 1.2, or JSF 2.0. The build contains many unit tests that can be automatically run against a variety of platforms. If you build from the JSFUnit trunk then you will build all of the JSFUnit modules, including the examples that are used to run the unit tests and integration tests. Each example needs to be properly assembled for for a specific container. So each container requires certain profiles to be set during the Maven build. Except for Jetty, these containers also require that an environment variable is set for the container's home. Here are the containers and the command to build for each:
*Note that you should not use the test profile with JBoss 6x. |
Setting the Container HomeYou can set the CATALINA_HOME or JBOSS_HOME any way you like, but if you plan to run the JSFUnit test suite against more than one container, it is convenient to tie the HOME setting to a profile in your Maven settings.xml file. |
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>jboss5x</id>
<properties>
<JBOSS_HOME>/jboss-5.0.0.GA</JBOSS_HOME>
</properties>
</profile>
<profile>
<id>tomcat5x</id>
<properties>
<CATALINA_HOME>/apache-tomcat-5.5.26</CATALINA_HOME>
</properties>
</profile>
<profile>
<id>tomcat6x</id>
<properties>
<CATALINA_HOME>/apache-tomcat-6.0.16</CATALINA_HOME>
</properties>
</profile>
</profiles>
</settings>
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
</listener>