I would like to add a unit test to test the style class gets set correctly. Unfortunately the getter getStyleClass
requires a FacesContext
. Any ideas?
views:
146answers:
1
+2
A:
Use JSFUnit. It's designed for exactly those purposes. Here's how it introduces itself:
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.
BalusC
2010-02-17 17:00:46