JSFUnit is a test framework for JSF applications. It is designed to allow complete integration testing and unit testing of JSF applications using a simplified API. JSFUnit tests run inside the container, which provides the developer full access to managed beans, the FacesContext, EL Expressions, and the internal JSF component tree. At the same time, you also have access to parsed HTML output of each client request.

After each faces request, you get access to the full internal state of your application through the FacesContext. With the FacesContext in hand, you have the keys to the kingdom. Between the JSF API and the JSFUnit helper classes, you can see what "really happened" after each request. You can also make additional HTTP requests to simulate a user session. And, since your application is fully deployed, you can assert state at any level of abstraction all the way from the client HTML down to your database.

The typical usage pattern of JSFUnit is to programatically submit an http request and examine both the parsed HTML output and the JSF internals. JSFUnit makes this very easy to do.

Tests validate:

Managed Beans "What is the state of my managed beans?" This can include managed beans in Seam-defined scopes such as conversation scope. You can test anything reachable with the Expression Language.
Navigation "Did this request take me to the correct JSF view?"
View Components "Does the JSF component tree contain the correct components?" "Do these components have the expected state?"
Invalid Input "Does invalid input generate the proper FacesMessage and error to the user?"
Application Configuration "Is my application configured as expected?" Because you have access to FacesContext, you can also call FacesContext.getApplication(). From there you can test to make sure your application configuration is correct. This would include tests for proper installation of converters, validators, component types, locales, and resource bundles.
Anything Else "Did the request do what it should?" "Did the data make it to my database?" "Does my cache look OK?" "Did my security settings work properly?" "What about the HTML sent to the client?"

About the Project

Getting Involved If you wish to get involved as a developer in the JBoss JSFUnit project, please visit the forum and get to know people. Also, it is recommended you visit the Jira pages to get a glimpse of the status or project tasks.
All of the developers on the JBoss JSFUnit project began as independent contributors to one JBoss project or another. JBoss core developers are guided by a meritocracy, and we hire talent anywhere in the world it may be.
Community Our forum and mailing list are the main channels of communication between all community members. If you experience problems, have questions, or simply want to meet the community, visit the forum.
Project Status JBoss JSFUnit uses the JIRA tracking and project management system to organize and prioritize tasks.
JBoss JSFUnit Project| Open Issues | Roadmap
History The JBoss JSFUnit project was created at the behest of Julien Viet, the JBoss Portal project lead. He was frustrated by the lack of JSF testing tools and insisted that we need something that can test JSF applications at higher levels of abstraction. Stan Silvert, the JSF lead from the JBoss AS team, came up with the current JSFUnit architecture and serves as JSFUnit project lead. Significant contributions have also come from committers Matt Wringe, Dennis Byrne, Brian Gregory, and Jason Fager. Many other early adopters both inside and outside of JBoss been contributing ideas and patches.
Professional Support JBoss Inc. delivers the Professional Support, Consulting, and Training that you need whether you are testing a proof of concept, deploying a mission-critical application, or rolling out JEMS across your enterprise.