Running Arquillian tests

Once all the necessary settings and test classes are ready, you can run the Arquillian tests. This process is just like running any unit tests in your project. For example, with Maven, you can use the following command:

    mvn test  

Arquillian takes the following steps to run the tests:

  1. When the test is run, the @org.junit.runner.RunWith(Arquillian.class) annotation present on the test class tells JUnit to invoke Arquillian for running the tests instead of the default runner built into JUnit.
  2. Arquillian then looks for a public static method annotated with the @org.jboss.arquillian.container.test.api.Deployment annotation in the test class to retrieve the deployable archive.
  3. In the next step, Arquillian contacts the container configured in arquillian.xml and deploys the archive to the container.
  4. All methods annotated with @org.junit.Test are run now.
An in-depth coverage of Arquillian is beyond the scope of this book. To learn more about Arquillian, visit http://arquillian.org.
The Jersey framework comes with built-in support for unit testing the JAX-RS server-side components. However, this lacks many features as compared to Arquillian and is not an ideal tool for performing full-fledged integration tests on Java EE components. You can learn more about the Jersey test framework at https://jersey.java.net/documentation/latest/test-framework.html.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.0.85