Class KarafOptions

java.lang.Object
org.codice.ddf.test.common.configurators.KarafOptions
All Implemented Interfaces:
Supplier<org.ops4j.pax.exam.Option>, ContainerOptions

public class KarafOptions extends Object implements ContainerOptions
Provides the configuration Options required to run Pax Exam and Karaf. Application specific configurations such as bundles and features should be configured using an implementation of ApplicationOptions.

The following system properties can be used to customize the Karaf's runtime behavior:

  • keepRuntimeFolder: keeps the runtime folder after the tests complete
  • isDebugEnabled: enables the remote debug agent and port (5005)
  • maven.repo.local: sets the maven repository where local artifacts will be retrieved
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.ops4j.pax.exam.Option
    get()
    Gets the basic Pax Exam configuration Options for the container.
    static org.ops4j.pax.exam.Option
    Pax Exam 4.14.0 starts both the JUnit 4.13.2 and Hamcrest-all 1.3 ServiceMix bundles by default, but they both export some Hamcrest packages.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KarafOptions

      public KarafOptions(PortFinder portFinder)
      Constructor.
      Parameters:
      portFinder - instance of the PortFinder to use to assign unique ports to the new Pax Exam container
  • Method Details

    • get

      public org.ops4j.pax.exam.Option get()
      Description copied from interface: ContainerOptions
      Gets the basic Pax Exam configuration Options for the container. Implementers should use Pax Exam's CoreOptions.composite(Option...) to combine multiple options into one if needed.
      Specified by:
      get in interface ContainerOptions
      Specified by:
      get in interface Supplier<org.ops4j.pax.exam.Option>
      Returns:
      Pax Exam configuration Options
    • overridePaxExamJUnitHamcrest

      public static org.ops4j.pax.exam.Option overridePaxExamJUnitHamcrest()
      Pax Exam 4.14.0 starts both the JUnit 4.13.2 and Hamcrest-all 1.3 ServiceMix bundles by default, but they both export some Hamcrest packages. That causes problems when the test probe tries to resolve Hamcrest classes. To fix this, we override Pax Exam's bundles and substitute a wrapped JUnit (which does not contain Hamcrest) for the ServiceMix version.