Concepts

Skip to end of metadata
Go to start of metadata

Mode

Since release 3.0.0.M1, Pax Exam supports three operation modes OSGi, Java EE and CDI. OSGi is the default mode and the only one available in Pax Exam <= 2.4.0.

OSGi Mode

In OSGi mode, Pax Exam starts a test container with an OSGi framework, lets you provision bundles by configuration options and builds a probe bundle from the test classes and resources of your current project.

Java EE Mode (since 3.0.0.M1)

In Java EE mode, Pax Exam starts a Java EE application server, deploys WAR modules defined in configuration options and builds a WAR probe from the contents of the current class path. The WAR probe includes your test cases which are invoked by the driver via a servlet bridge. The tests are executed within the Java EE container, the test results are returned to the driver as a HTTP result.

CDI Mode (since 3.0.0.M1)

In CDI mode, Pax Exam starts a CDI container in the current VM, providing the subset of CDI functionality which does not require a Java EE environment. CDI mode does not use probes, all tests are directly invoked by the driver after injecting dependencies using the CDI bean manager.

Framework

In the context of Pax Exam (OSGi mode), the term framework usually refers to the OSGi framework running the system under test.

System under test

The system under test is the collection of your application and library bundles.

Pax Exam aims at executing black box tests, but in fact the box (i.e. the container) is slightly grey, as Pax Exam adds some bundles of its own and the probe.

Test Container

The test container is a thin wrapper around the framework, the system under test and the probe, adding the ability to communicate with the driver and the outside world in general.

Reactor

The reactor manages the collection of all tests to be executed in one or more different containers. The reactor starts and stops the required containers and provisions bundles and probes to the containers.

Driver

The driver is the entry point into Pax Exam. It evaluates configuration options and creates a reactor based on these options. The driver receives the test results and handles them in an implementation dependent way.

Pax Exam includes different drivers:

  • The JUnit Driver integrates Pax Exam with JUnit.
  • The TestNG Driver integrates Pax Exam with TestNG.
  • The Pax Exam Player provides a simple low-level API for running tests.

Probe

The probe is a synthetic artifact which Pax Exam adds to the system under test.

In OSGi mode, Pax Exam creates the probe on the fly with the help of Tinybundles. The probe contains the current test class and all classes and resources found under the same root.

In Java EE mode, the probe is a WAR containing all test classes, resources and dependencies on the classpath, the servlet bridge and some other Pax Exam dependencies.

In CDI mode, there is no probe, all test methods are invoked directly.

Configuration

The configuration determines the set of bundles provisioned to the container, the framework to run in the container and some system and environment properties.

Each driver has its own method of letting the user specify configuration options. The JUnit driver requires one or more methods annotated by @Configuration with return type Option[].

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Clicky Web Analytics