Why do you want to implement another testing framework? Why do you not consider WebTest http://webtest.canoo.com ?The answer is that frameworks like WebTest, HttpUnit, HTMLUnit, etc. only test the client side. These are pure black-box frameworks for web apps.
With JSFUnit, you get both client side and server side testing in one test. Some call this grey-box testing.
Plus, the JSFUnit API is written specifically for ease of testing everything you would want to know about a JSF application.
For instance, with JSFUnit I can not only submit data on a form, I can also make sure that managed beans were properly updated (using EL expressions).
I can make sure that my component tree on the server side is correct using the actual server-side objects created by JSF. Checking the server-side component tree has three distinct advantages that you don't get with just checking the HTML:
- It's much easier as I can make simple JSF API calls instead of checking raw text or the contents of the client-side DOM.
- I don't have to rewrite my test when the HTML changes.
- I can validate components where rendered=false. In this case, the component is not rendered on the client side, but still has state on the server side.
I could go on and on about server side testing. There is a lot more to be validated such as database state, security state, and even memory usage.
If I want to do the client side (black box) testing, JSFUnit gives full access to the HttpUnit API and the client-side DOM. So that is covered as well. And again, I can even do both black box and white box testing in the same test if I want.
Lastly, JSFUnit includes static analysis tests that do validation of your configuration beyond what JSF itself provides. This lets you know about problems specific to JSF that you can catch long before they show up in some obscure use case at run-time.
Good question Anonymous. So long, and thanks for all the fish,