Pax Exam

This Confluence space covers the current Pax Exam 4.x release line. The previous Pax Exam 3.x release line is documented in the OPS4J Pax Exam 3.x space.

In-Container Testing for OSGi, Java EE and CDI

OSGi Testing

  • Pax Exam lets you take control of the OSGi framework, the test framework (e.g. JUnit) and your system under test at the same time.
  • Pax Exam is also able to bootstrap a Apache Karaf container allowing you to directly execute commands, deploy features, etc.
  • Pax Exam has a test driver and a test container. The driver launches the OSGi framework and the system under test. It builds on-the-fly bundles from your test cases and injects them into the container. The driver is a plain old Java application and does not itself require an OSGi framework.
  • The test container comes in two flavours: The Native Container launches an embedded OSGi framework in the test driver VM. With the Forked Container, the system under test runs in a separate Java virtual machine under remote control from the test driver.
  • Test containers support different strategies for restarting or reusing the running OSGi framework for each test.
  • With the PaxExam JUnit runner, you simply need to add some special annotations and a configuration method to a JUnit class to run your OSGi tests. Thanks to this runner, any JUnit integration (e.g. in Eclipse or Maven Surefire) works with Pax Exam out of the box.
  • Pax Exam itself is distributed as Maven artifacts and lets you provision Maven bundles to your OSGi framework directly from local or remote Maven repositories.
  • Pax Exam supports all major OSGi frameworks (Equinox, Felix, Knopflerfish), based on OSGi 4.3 or higher.
  • Read more: Getting Started with OSGi Tests

Java EE 7 and CDI 1.1 Testing

  • Pax Exam 4.x generalizes the in-container testing approach to cover not only OSGi, but also Java EE and CDI components and applications.
  • Simply add @RunWith(PaxExam.class) to your JUnit test classes and let Pax Exam launch a full-blown Java EE server or a stand-alone CDI container and execute your tests within the container.
  • In Java EE mode, Pax Exam uses sensible defaults to build a test WAR on the fly, based on the classpath. There is no need to explicitly configure this WAR for each test.
  • All classes of a test suite can share the same setup.
  • Pax Exam 4.x supports GlassFish 4.x and Wildfly 8.x.
  • In CDI Java SE mode, Pax Exam supports Weld 2.x.
  • For other Java EE 6 or CDI 1.0 containers, have a look at Pax Exam 3.x.
  • Read more: Getting Started with Java EE Tests and Getting Started with CDI Tests

Unit Test Frameworks

Pax Exam is best used with JUnit 4, but also supports TestNG 6.

Latest News

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.13.0.

This release contains some fixes related to JDK9+ compatibilty.

key summary type created updated due assignee reporter priority status resolution
Loading...
Refresh

Pax Exam 4.11.0 released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.11.0.

This release fixes the following issues, and also upgrades to Pax Swissbox 1.8.3:

key summary type created updated due assignee reporter priority status resolution
Loading...
Refresh

As usual, all artifacts are available from Maven Central.

Pax Exam 4.9.1 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.9.1.

This is a maintenance release with a number of dependency upgrades, including a fix for a regression introduced in 4.9.0.

All users of Pax Exam 4.x are recommended to upgrade to 4.9.1.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 4.8.0

type key summary
Loading...
Refresh

Pax Exam 4.7.0 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.7.0.

The main feature of this release is an embedded mode for the Karaf Test Container.

All users of Pax Exam 4.x are recommended to upgrade to 4.7.0.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 4.6.0

type key summary
Loading...
Refresh

Pax Exam 4.6.0 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.6.0.

The main feature of this release is a new test container pax-exam-container-wildfly90 for WildFly 9.x and 10.x.

All users of Pax Exam 4.x are recommended to upgrade to 4.6.0.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 4.5.0

type key summary
Loading...
Refresh

Pax Exam 4.5.0 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.5.0.

This is a maintenance release with some dependency upgrades and bugfixes.

Highlights:

  • OSGi 6 support (Equinox 3.10, Felix 4.6) monitored by regression tests
  • Several bugfixes for Forked Container.

All users of Pax Exam 4.x are recommended to upgrade to 4.5.0.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 4.4.0

type key summary
Loading...
Refresh

Pax Exam 4.4.0 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.4.0.

This is a maintenance release with some dependency upgrades and bugfixes.

Highlights:

  • Upgrade to JUnit 4.12 (using the OSGified version from Pax Tipi)
  • Support for WildFly 8.2.0

All users of Pax Exam 4.x are recommended to upgrade to 4.4.0.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 4.3.0

type key summary
Loading...
Refresh

Pax Exam 4.3.0 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.3.0.

This is a maintenance release with dependency upgrades for all OPS4J dependencies as well as bugfixes and new features.

Highlights:

  • Support for GlassFish 4.1
  • Support for WildFly 9.0
  • Maven archetypes for OSGi, GlassFish and WildFly tests (in group org.ops4j.pax.exam.archetypes)

All users of Pax Exam 4.x are recommended to upgrade to 4.3.0.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 4.2.0

type key summary
Loading...
Refresh

Pax Exam 4.2.0 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.2.0.

This is a maintenance release with two bug fixes for the Karaf Test Container.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 4.1.0

type key summary
Loading...
Refresh

Pax Exam 4.1.0 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.1.0.

This is a maintenance release with a couple of bug fixes and dependency upgrades.

All users of Pax Exam 4.0.0 are recommended to upgrade to 4.1.0.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 4.0.0

type key summary
Loading...
Refresh

Pax Exam 4.0.0 Released

The Pax Exam team is happy to announce the release of OPS4J Pax Exam 4.0.0.

This is a major release raising the minimum requirements to Java SE 7, Java EE 7 and OSGi 4.3.

As a consequence, a number of test containers and other modules not compatible with these requirements have been dropped.

There is no new functionality in this release, the main focus was dependency upgrade and pruning. Please see What's New? for an overview of major changes.

As usual, Pax Exam artifacts are available from Maven Central.

Changes since 3.5.0

type key summary
Loading...
Refresh