File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Blatant Advertising and the fly likes ANNOUNCE:  Stan Silvert on Testing JSF Applications with JSFUnit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Blatant Advertising
Bookmark "ANNOUNCE:  Stan Silvert on Testing JSF Applications with JSFUnit" Watch "ANNOUNCE:  Stan Silvert on Testing JSF Applications with JSFUnit" New topic

ANNOUNCE: Stan Silvert on Testing JSF Applications with JSFUnit

Kito Mann
Ranch Hand

Joined: Dec 11, 2003
Posts: 124

In this podcast, JSFCentral editor-in-chief Kito D. Mann talks with Stan Silvert about JSFUnit, an open source integration testing and debugging framework for JSF applications and JSF AJAX components. This interview was recorded in September of 2008 at JSFOne.

Here is an excerpt:

Kito: So let’s say I am writing my JSF application and I decide I want to get JSFUnit and I download it. What do I have to do? Let’s say I want to test…like a login page and I have written my backing bean and have some components on the page and I want to test that it works OK.

Stan: What you do is get the JSFUnit JAR, of course with several supporting JARs. There is a “getting started” page -- if you go to you can see all this step by step. You get the JARs, you do make some modifications to your web XML to set up a couple of filters and a couple of extra filters that are used by Cactus, which is what we use to do the in-container magic for JUnit. Then you write your test, which is usually very few lines of code. You have a JSF client session and a JSF server session so you use the JSF client session to click things on the page and you input things on the form and such as that. Then every time there is an HTTP request you can go to this JSF server session object and look at all the things on the server, like the value of your managed beans. Did the value really make it into the managed bean like you expected? Did the component tree turn out the way you expected? It is a very powerful way to do assertions instead of having to do assertions on the HTML – which is something we still allow you to do – but really a better way is to assert that the JSF component tree turned out right. Because that is what your logic actually took care of. Like I say, it’s not many lines of code to write tests to test things.

Read the full article or download the podcast here:

Kito D. Mann -- Author, JavaServer Faces in Action - JSF/Java EE consulting, training, and mentoring - JavaServer Faces FAQ, news, and info
+1 203-404-4848 x3

Kito D. Mann
Author of JSF in - JSF FAQ, news, and info
I agree. Here's the link:
subject: ANNOUNCE: Stan Silvert on Testing JSF Applications with JSFUnit
It's not a secret anymore!