This library provides a simple and direct access to execute integration tests against any Apache Karaf based distribution.
-
Add the distribution as dependency to your pom.xml
-
Add the depends-maven-plugin to your pom:
<plugin> <groupId>org.apache.servicemix.tooling</groupId> <artifactId>depends-maven-plugin</artifactId> <version>1.2</version> <executions> <execution> <id>generate-depends-file</id> <goals> <goal>generate-depends-file</goal> </goals> </execution> </executions> </plugin>
- Make sure that in the resources folder a context configuration file for your system exists and is named according to the form endtoend.[[osName]].[[osArch]].properties
Currently possible values are: osName: linux, mac, win osArch: x86, x86_64, amd64
- Define at least the distribution.uri in the configuration file: distribution.uri = mvn-vless:[[groupId]]:[[artifactId]]:[[type]]:[[classifier]]
Other possible parameters are: karaf.appname (default: karaf) karaf.port (default: 8101) karaf.cmd (default: bin/karaf) karaf.client.cmd (default: bin/client) karaf.root (default: .)
- To run tests on your distribution use the framework like this:
DistributionResolver dr = new DistributionResolver(); DistributionExtractor ds = new DistributionExtractor(new File(EXTRACTION_DIR)); testContextLoader = new TestContextLoader(dr, ds); testContextLoader.loadContexts(); defaultContext = testContextLoader.getDefaultTestContext(); context.setup(); // Test distribution... context.teardown();
A good working example can be found in ExecuteListCommandTest in the itest module.
The full documentation is located at the github wiki
While all final releases are available via maven central you can also build latest snapshots locally by using "mvn install" with Apache Maven 3.x and Java 7.x.