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 Camel with Blueprint and Apache Karaf


This recipe will cover how to test a Camel Blueprint definition. The focus of this recipe will be on the test and how it differs from the Testing Apache Karaf features recipe.

Getting ready

It's best to have gone through the Testing Apache Karaf features recipe and the Creating a Blueprint-based Camel Router for deployment in Apache Karaf recipe before starting this follow-up recipe. The sources of this chapter are available at https://github.com/jgoodyear/ApacheKarafCookbook/tree/master/chapter10/chapter10-recipe5.

How to do it…

Since we have based this recipe on the Testing Apache Karaf features recipe, we already have a basic setup containing the setup of the Apache Karaf container. Additionally, we need the Apache Camel feature for Karaf. This way all the bundles required for testing a Camel route are present. The test itself requires the Camel Context of the blueprint.xml definition to attach itself to its mock object. This can be done...