Setting up a Pax Exam test environment

This recipe will guide you through the basic setup of a Pax Exam test environment using the Felix framework as the core OSGi container. The next recipe will cover how to combine Pax Exam and Apache Karaf.

How to do it…

To perform integration tests with Pax Exam, the POM configuration is essential, since it is already part of the build environment. For example, use the pax-exam-container-native artifact and of course it is mandatory to connect JUnit with Pax Exam. This can be done as follows:

… <properties> <version.pax-exam>3.4.0</version.pax-exam> <junit.version>4.11</junit.version> ...

Get Apache Karaf Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.