| |
| |
| h1. Writing integration tests |
| |
| We recommend using [PAX Exam|http://team.ops4j.org/wiki/display/paxexam/Pax+Exam] to write integration tests when developing |
| applications using Karaf. |
| |
| Karaf provides an helper library to help writing such integration tests. |
| {pygmentize:java} |
| @Configuration |
| public static Option[] configuration() throws Exception{ |
| return combine( |
| // Default karaf environment |
| Helper.getDefaultOptions(), |
| // Test on both equinox and felix |
| equinox(), felix() |
| ); |
| } |
| {pygmentize} |
| |
| If you need to provision a few features in addition to the default Karaf environment, you can do so by adding the following code: |
| |
| {pygmentize:java} |
| scanFeatures( |
| maven().groupId("org.apache.felix.karaf") |
| .artifactId("apache-felix-karaf") |
| .type("xml").classifier("features") |
| .versionAsInProject(), |
| "obr", "wrapper" |
| ), |
| {pygmentize} |
| |
| |
| |