Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This demo project offer a simple Object oriented implementation of a calculator with only the four basic operations. As it is a Java EE application, the operation are logged in a Derby database to offer a persistence layer for the demonstration. A REST API offer the possibility to submit operation to solve and another one to retrieve the logged operations submitted.

In this third version of the project, the Integration tests are implemented and integrated with Probe Dock and Probe Dock RT.

We use the Arquillian testing framework with JUnit implementation of the tests.


  • Java 7+
  • Maven 3.1


  1. Run the tests via maven with mvn clean test in project folder. The Integration tests present in the project will be run.

If Probe Dock RT is running, you should see the test results in the tool.

  1. If not done, make sure you already done the step 2 to 4 from the second project.

  2. We want to let the test category of the tests run to appear as Arquillian and not JUnit. Then we will use a feature present in Probe Dock Java since version 0.4.0. We have the possibility to configure categories by package patterns. For that, we have to write the following configuration.

    io.probedock.demo.jeestack.integration.*: Arquillian

When a test is executed and is in a class in a sub-package of io.probedock.demo.jeestack.integration, the category will be Arquillian.

  1. Now, you can run the tests again via maven with mvn clean test. In addition of the test results shown in Probe Dock RT, you will also see results on Probe Dock on the dashboard. You are able to see the result details by clicking on the report line.

  2. Now you can play a bit with the tests. Break some tests and see the results on both interfaces. Play with the @ProbeTest and @ProbeTestClass annotations. You can also read the documentation of Probe Dock Junit and Probe Dock RT Arquillian Extension for more details about the probes used to send the test results. You have also several information on the library used by both probes. Finally, you will find the list of probes and libraries on these pages: Probe Dock Probes and Probe Dock RT Probes.

What have been done to integrate Probe Dock?

  1. Introduced two new dependencies in pom.xml
    <!-- JUnit dependency, same as Unit tests -->

    <!-- AssertJ to write better assertions, same as Unit tests -->

    <!-- Probe Dock and Probe Dock RT probes dependencies -->
    <!-- The Probe Dock RT is different than for the Unit tests as it is an
         extension of Arquillian. Therefore, the Probe itself is a dependency of
         the extension. -->

    <!-- Arquillian dependencies to make Integration tests working with
         a Glassfish 4.1.1 Embedded Application Server. -->
  1. We also added a plugin management for Arquillian version management.
  1. We added the Maven Surefire Plugin with some configuration to run the tests with Probe Dock JUnit listeners. The configuration is the same as we did for Unit tests.
  1. We added several configuration files for Arquillian:
  1. We have written several integration tests in src/test/java. The tests required some Arquillian preparation. First, we needed to add the test runner from Arquillian:
public class ...

Then we added a deployment method to Arquillian how to prepare the test run. This setup depends of the requirement for the test.

public static JavaArchive createDeployment() {
  JavaArchive jar = ShrinkWrap
    // Create the Java Archive

    // Add the test persistence.xml for the persistence configuration
    .addAsManifestResource("test-persistence.xml", "persistence.xml")

    // Add the classes needed by the tests

    // Add the beans.xml to enable the CDI
    .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

  return jar;
  1. Then you have added the probedock.yml file with the modification for the category.