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
- Rename your war with a "-jsfunit" suffix (such as "mywar-jsfunit.war")
- Add your test classes to the WAR or put them in
- 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,