Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{scrollbar}

Anchor
top
top

5.4. Writing integration tests

We recommend using PAX Exam to write integration tests when developping applications using Karaf.

Since version 1.4.0, Karaf provides an helper library to help writing such integration tests.

Code Block
   @Configuration
   public static Option[] configuration() throws Exception{
       return combine(
           // Default karaf environment
           Helper.getDefaultOptions(),
           // Test on both equinox and felix
           equinox(), felix()
       );
   }

If you need to provision a few features in addition to the default karaf environment, you can do so by adding the following code:

Code Block
           scanFeatures(
                  maven().groupId("org.apache.felix.karaf")
                         .artifactId("apache-felix-karaf")
                         .type("xml").classifier("features")
                         .versionAsInProject(),
                  "obr", "wrapper"
           ),

#top

Wiki Markup
{scrollbar}