JBoss Core Developer with over 20 years of industry experience
Stan Silvert is a JBoss Core Developer with over 20 years of industry experience. He is the project lead on the JSFUnit open source project.JSFUnit is an integration test framework for JSF applications. It is designed to allow complete integration testing and debugging of JSF applications and JSF AJAX components. Stan is also responsible for JavaServer Faces and Seam integration on the JBoss Application Server.
He has represented JBoss/Red Hat on several JSF-related JSRs in the Java Community Process. These include the JSF core specification and the JSF Portlet Bridge specification.
Presentations by Stan Silvert
Holistic testing of JSF applications
This session will present everything you need to get started building a test suite that validates your JSF application from end to end."Test, Test, JSF
This is a blog about testing and JSF. But mostly, it's about JSFUnit, the new JSF testing framework from JBoss.
Sunday, October 12, 2008
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
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 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:
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
Enter the new JSFUnit deployer for JBoss AS 5. Now, here is all you need to do to set up JSFUnit for testing:
- Copy jboss-jsfunit-microdeployer.jar to
/server/default/deployers - Rename your war with a "-jsfunit" suffix (such as "mywar-jsfunit.war")
- Add your test classes to the WAR or put them in
/server/default/jsfunitTests - Restart JBoss AS 5 and run your tests.
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 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
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
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
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
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
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