very good work. will this work with JSF and Ajax4jsf?
I just added Ajax4jsf support to JSFUnit (http://www.jsfunit.org
). JSFUnit is a new unit testing tool that runs in-container and allows access to JSF context objects and managed beans without needing mocks. The tests are written in regular JUnit, with a little help from Apache Cactus and HTTPUnit.
JSFUnit has not been released yet, but there are instructions to checkout and build. If you do, you will find an sample app that tests three of the standard ajax4jsf demos.
This technique is not really meant for testing client-side AJAX. It is more appropriate for testing server-side state changes that result from the AJAX calls. And JSF (server side) state is mostly what JSFUnit is about.
Like Marc, I'm struggling with this question of how best to test AJAX apps. If his methods turn out to be good I may replace HTTPUnit with HTMLUnit or even with WebTest. Then you would have the best of both worlds testing client-side AJAX and server-side JSF all in the same test.