07 enero 2009

JSFUnit

JSFUnit


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.

No hay comentarios: