-
1. Re: Unit testing my backing beans
ssilvert Oct 17, 2007 1:59 PM (in response to keefie)You should start here:
http://www.jsfunit.org
JSFUnit is for in-container testing. It's very much like the Apache Cactus framework, but goes beyond it to support JSF constructs. IMHO, this is far better than using mock objects. With JSFUnit, you use a real FacesContext, the real HttpSession, the real JSF component tree, etc. So this way you don't need to worry about bugs and limitations in your mock objects.
Your UI is not really involved in that you don't have to feed keystrokes to it or anything like that. The JSFUnitClientSession allows you to set params and do submits using a simple Java API.
You do need to run a container, but you can configure things so that the container starts, tests run, and container stops as part of your build. It's very much like you are just running plain old JUnit tests. JSFUnit's own tests can be run this way. See this page http://labs.jboss.com/jsfunit/building-jsfunit.html for instructions on that.
Hope that helps. Let me know if you have further questions.
Stan -
2. Re: Unit testing my backing beans
keefie Oct 20, 2007 5:16 AM (in response to keefie)Thanks for the reply, I'm not going to start a mock object debate. However, is it possible to edit your reply to remove the quote from a "JBoss rocks stars" as I find it offensive.
-
3. Re: Unit testing my backing beans
ssilvert Oct 22, 2007 10:39 AM (in response to keefie)I wasn't trying to offend anybody. I do realize that some people consider rock to be the Devil's music. :-)
Have a nice day,
Stan