Arquillian Extension for Liferay Example

Arquillian is an extensible Java testing platform that’s designed to make integration testing easy. Arquillian manages the lifecycle of setting up, starting, or connecting to a container (e.g., Tomcat), packaging your test cases and any dependent classes or resources, deploying them to the container, running the tests in the container, and capturing and reporting the results. The Arquillian Extension for Liferay is a set of tools designed to help developers test their Liferay plugins.

The Arquillian Blade Example project demonstrates performing integration and functional tests using the Arquillian Liferay Extension. Additionally it measures code coverage using JaCoCo. In this tutorial, you’ll learn how the Arquillian Liferay Extension and JaCoCo work. You can download the Arquillian Blade Example project here or access its latest code on GitHub.

Here are the tutorial sections:

Arquillian Example Sample Portlet

The sample portlet calculates the sum of two numbers. Figure 1: The Arquillian Sample Portlet calculates the sum of two numbers. The portlet project comprises a portlet class, service classes, and...

Read More

Arquillian Integration Test Example

Integration tests exercise module interaction. The following integration test validates the sample portlet using its API. Although the example’s BasicPortletIntegrationTest class demonstrates...

Read More

Arquillian Functional Test Example

Where the integration test invokes the SampleService’s add method directly, the functional test invokes the add method indirectly using a web browser. The Arquillian Blade Example’s functional...

Read More

JaCoCo Code Coverage Example

JaCoCo measures Java code coverage. The Arquillian Blade Example uses JaCoCo to report parts and percentages of the product code the tests execute. Figure 1: JaCoCo reports lines of code tests...

Read More

Running the Arquillian Example

You’re ready to run the Arquillian Blade Example tests. Open a terminal to the project root and execute the following command: gradlew testIntegration The command does these things: Downloads and...

Read More
0 (0 Votes)
Injecting Service Components into Tests Previous