HTML and CSS Reference
What Is Arquillian?
Arquillian is a complete platform for in-container testing of Java EE applications. Arquillian integrates with testing
frameworks such as JUnit and TestNG making it easy to adopt for anyone comfortable writing unit tests. Arquillian
uses an embedded application server of your choice to deploy the classes and resources subject to testing. Once the
JSF application has been deployed in the embedded application server, you can test the behavior of the system by
calling the classes and resources and inspecting their response. Out-of-the-box Arquillian is capable of testing JEE
components such as EJBs and CDI beans. Several extensions have been built for Arquillian to support functional
testing. Table 11-6 outlines popular extensions to Arquillian.
Table 11-6. Popular Extensions for Arquillian
Wrapper for the WebDriver API also used by Selenium. This extension makes it
possible create simple functional tests.
Simulating interactions on the client-side while examining the change of state
on the server side at the different phases of the JSF request lifecycle.
Enhances the Drone extension by gracefully supporting Ajax through guarding
and interception of requests.
Verify the persistence layer of the application. Allows for seeding the database
using common data formats such as XML, XLS, YAML, JSON, and SQL.
Verify that tests execute within a given time range. Will catch performance
issues during regression testing.
Allows testing of Seam libraries and injection points.
In this section we will explore how to use Arquillian and the Drone extension to do blackbox testing of JSF
applications. First we will look at how to set up Arquillian and Drone for a Maven project followed by looking at how to
write sensible JUnit tests using the Drone extension.
■ The Arquillian Warp Extension is the official replacement for the JSFUnit project, which is no longer being
maintained. At the time of writing, the Warp extension is still in Alpha state and no production examples are available.
Setting Up Arquillian and Drone
In this section we will look at how to set up Arquillian and Drone in a Maven project. If you do not use Maven
you can find guides on including the necessary dependencies in your project on the Arquillian website