Friday, August 29, 2008

JSFUnit Beta 3 is out. Seam support and more!

JSFUnit Beta 3 is now released. Special thanks to our new committer Brian Gregory for helping with the conversion from HttpUnit to HtmlUnit as our client side technology (see previous post). Also, the HtmlUnit team has been very helpful with answering questions and providing bug fixes.

Click http://wiki.jboss.org/wiki/JSFUnitBeta3Changes for details on new features. Unlike Beta 2, there are many goodies in this release, including support for Seam conversation scope!

If you are a Beta 2 user it is very important that you click the above link and read about the deprecated APIs that will be removed before GA. The next planned release will be 1.0.0.GA which should be out before the end of the year.

See this page for download information: http://www.jboss.org/jsfunit/downloads.html.
Keep all the valuable feedback coming. It is greatly appreciated!

See you at JSFOne next week.

So long, and thanks for all the fish,

Stan

Friday, August 8, 2008

Another JSFUnit Beta Coming Soon

And why we dumped HttpUnit for HtmlUnit

We will release JSFUnit Beta 3 before the start of JSFOne on Septemeber 4th. If all goes well, it will probably be out a week or so before that.

Originally, I planned to have the GA release out by now. But the opportunity to improve the JSFUnit tool was too great to pass up. That opportunity came in the form of HtmlUnit. HtmlUnit bills itself as "a headless browser". This is exactly what I've been searching for. That is, a way to truly simulate a user interacting with a JSF application - even one that includes AJAX components.

Up until now, JSFUnit used HttpUnit to submit client requests. And HttpUnit is good at that. But HttpUnit is old, and it's mostly a dormant project. It doesn't support the latest DOM specs. And worst of all, its javascript support is dismal. This makes testing JSF/AJAX applications very difficult. In fact, the javascript support was so bad I had to just turn it off. When testing a JSF/AJAX component I would have to simulate the javascript using Java and then formulate the resulting HTTP request myself. It became clear that it would be too hacky and time-consuming to keep doing things that way.

So for JSFUnit Beta 3, I've written a new version of the JSFClientSession class that uses HtmlUnit instead. With HtmlUnit, we can execute javascript and let that javascript submit to the server. No fuss, no muss.

HtmlUnit is still pretty new, so we've found our share of bugs along the way. But unlike HttpUnit, HtmlUnit has an active core of developers who are working closely with the JSFUnit team to fix problems quickly as possible. Thus, we're doing one last beta release instead of the planned GA.

For Beta 3, you can still use the old HttpUnit-based JSFClientSession and things will work fine. This allows our early adopters to migrate their tests to the new client one at a time. But HttpUnit will be completely gone from JSFUnit for GA. So you do need to migrate before then. The new stuff is in its own package called org.jboss.jsfunit.jsfsession. This replaces the old code in org.jboss.jsfunit.facade.

That's all the news for now. So long, and thanks for all the fish.

Stan