Sunday, October 12, 2008

JSFUnit experience required

The JSFUnit project has reached a new milestone. This is the first job posting I've seen where JSFUnit experience is required.

http://www.bidtowork.com/2008/10/09/java-test-engineer-with-jsfunit-and-httpunit-experience-odesk/

So long and thanks for all the fish,

Stan

Thursday, October 2, 2008

JSFUnit the Easy Way!!

JSFUnit tests are easy to write and understand. This comes across clearly whenever I talk about it at a conference and I see faces light up. They "get it". However, it's also clear that the hardest part of JSFUnit is getting started. Once you get over that hump, developers really like the tool. But until now, setting up JSFUnit for the first time required quite a bit of work.

Enter the new JSFUnit deployer for JBoss AS 5. Now, here is all you need to do to set up JSFUnit for testing:
  1. Copy jboss-jsfunit-microdeployer.jar to /server/default/deployers
  2. Rename your war with a "-jsfunit" suffix (such as "mywar-jsfunit.war")
  3. Add your test classes to the WAR or put them in /server/default/jsfunitTests
  4. Restart JBoss AS 5 and run your tests.
That's it. In fact, with a simple edit to the deployer's descriptor you can even get rid of step 2.

This is all made possible because of the redesigned microcontainer of JBoss AS 5. You can take an ordinary WAR and add servlets, filters, and classes on the fly as it is being deployed. I've been wanting this kind of functionality for as long as I can remember. It's perfect for adding test tools, fixtures, or monitoring. Before now you had to bundle this stuff with the application - stuff that really doesn't belong in your WAR.

The interesting part is that now instead of thinking of a WAR or EAR as "my application", we can truly think of it as a reuseable deployment unit. It's just another component that can be decorated or combined with other components. While this view provokes a lot of questions (security, name collisions, etc.), the mind reels with the possibilities that this represents.

So long, and thanks for all the fish,

Stan

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

Saturday, June 21, 2008

More JSFUnit on the Road

First Up, Jazoon '08
JSFUnit is hitting the road once again, but this time, it's not me doing all the hitting. Alexander Jesse of Credit Suisse will be giving a JSFUnit introduction at Jazoon next week in Zurich. If you are in Zurich on Tuesday, June 24th be sure to check it out. Jazoon offers one-day passes.
Click Here for More Details

Second Up, JSF One '08
I'll be doing at least one talk on JSFUnit at JSF One. This is the first dedicated JSF conference in North America. So if you are into JSF, you won't want to miss it. This is scheduled for September 4th in Vienna, VA (close to Washington, D.C.). And, you get two for the price of one because admission to JSF One also gets you into The Rich Web Experience conference.
Click Here for More Details or visit www.jsfone.com.

By the time JSF One rolls around, we should have a GA version of JSFUnit out. But more on that later.

So long, and thanks for all the fish,

Stan

Tuesday, April 15, 2008

Cactus 1.8 is released

Congratulations to Petar Tachiev on the release of Cactus 1.8. This is the first release of Cactus in over 3 years. Thanks to Petar for taking over as project lead and getting a new release out the door. This release appears to cover mostly bug fixes and Cargo integration, which allows support of more containers.

He's also updated the build so that both Cactus and its web site are built using Maven.

See the Cactus Site for details.

If you've been following JSFUnit, you know that it is built on Cactus, so I'm very happy to see that project come back to life.

Life goes on for JSFUnit as well. The JSFUnit forum has been very popular lately and folks have been anxious to get their hands on a new release. So I'm planning a second beta release for next week. This will be mostly bug fixes, but it will include some new features as well.

Unfortunately, major new features like Seam support will have to wait for 1.0 final. We've made some progress, but it's not ready for prime time. Also, if you have a new feature that you really need in JSFUnit, make it known in the forum thread here. I'll do my best to make sure that new features are community-driven.

So long, and thanks for all the fish,

Stan