Over a million developers have joined DZone.

New JSFUnit Hops on Arquillian Bandwagon

DZone 's Guide to

New JSFUnit Hops on Arquillian Bandwagon

· Java Zone ·
Free Resource
JBoss' Java Server Faces testing framework, JSFUnit, has just released version 1.3 with a couple of new features and one significant fix that now allows integration with another JBoss project - Arquillian.  For those who don't know about Arquillian, it basically abstracts away container lifecycle and development from test logic so that developers can easily develop a broad range of integration tests for Java EE applications.  For all intents and purposes, the Arquillian class is a managed bean inside the container.  Arquillian essentially lets you skip the build and test 'in-container' (any place where a runtime is managed and a component model, set of services, and resources are provided).  It essentially lets you build in Java, so that's why the tagline is "skip the build".

The three main changes in JSFUnit 1.3 include:

  • New drag-and-drop API call on the RichFacesClient
  • Compatibility updates with HtmlUnit 2.8
  • Bugfix for Arquillian compatibility

The HtmlUnit 2.8 compatibility will solve a lot of problems when using JSFUnit and HtmlUnit because the 2.7 version had a lot of bugs.  The main news however, is the Arquillian compatibility, which can now be used to run JSFUnit tests instead of Cactus and Cargo.

The integration with Arquillian can bring several features to JSFUnit testing that the framework didn't have before.  Users of JSFUnit and Arquillian can use the @Test annotation because of Arquillian's full JUnit 4 support.  They can also use TestNG 5.

Arquillian also allows resource injection (@Inject, @EJB) directly into your test classes.  You also have the ability to test only the subsets of your WAR file so that single tests will run faster.

One reason why you might still need to use Cargo is its container support.  Arquillian currently supports only Tomcat, Jetty, JBoss AS, and Glassfish.

Aslak Knudsen, the developer who submitted the key bugfix, already has a proof of concept and developers should have a means to perform this integration in a few days.  Stay tuned to Stan Silvert's blog for more details.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}