Book Image

Apache Karaf Cookbook

By : Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler
Book Image

Apache Karaf Cookbook

By: Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler

Overview of this book

Table of Contents (17 chapters)
Apache Karaf Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Testing Apache Karaf features


After going through the Setting up a Pax Exam test environment recipe, you should be ready to test OSGi applications in general. Now, let's take a closer look at what is needed to run a test with Apache Karaf as the container.

Getting ready

As in the previous chapters, the sources are available at https://github.com/jgoodyear/ApacheKarafCookbook/tree/master/chapter10/chapter10-recipe2. To fully understand this recipe, it is best to have gone through the previous recipe.

How to do it…

In the Setting up a Pax Exam test environment recipe, we defined the Felix framework as the runtime container. Now, we need to change this to Apache Karaf, so the first changes need to be done to the POM configuration. Pax Exam needs to know that it needs to run with Apache Karaf as the container; this is configured using the following:

  1. The pax-exam-container-karaf dependency as a replacement dependency for the Felix framework.

  2. The apache-karaf ZIP artifact to be used as the runtime container...