Class DdfComponentOptions

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

public class DdfComponentOptions extends DdfBaseOptions
Provides the basic DDF configuration Options required to run component tests in Pax Exam. The class uses the base Karaf distribution and will automatically start the bundle under test (see note below). Any other bundles and features required to run the tests in the container can be provided by extending this class and implementing DdfBaseOptions.getBundleOptions() and DdfBaseOptions.getFeatureOptions(). Other configuration options can be provided by overwriting DdfBaseOptions.getExtraOptions().

Important: This configuration class uses the karaf.version system property to determine the Karaf distribution version to deploy in the Pax Exam test container. It also uses the component.artifactId and component.version system properties to determine the name of the bundle under test and automatically start it. Those properties must therefore be set before running the test class. Here's an example of how Maven's failsafe can be configured to run the tests:


 <plugin>
     <artifactId>maven-failsafe-plugin</artifactId>
     <version>${failsafe.version}</version>
     <configuration>
         <systemPropertyVariables>
             <pax.exam.karaf.version>${karaf.version}</pax.exam.karaf.version>
             <component.artifactId>${artifactId}</component.artifactId>
             <component.version>${project.version}</component.version>
         </systemPropertyVariables>
     </configuration>
 </plugin>
 
See Also:
  • Constructor Details

    • DdfComponentOptions

      public DdfComponentOptions(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: ApplicationOptions
      Gets the Pax Exam configuration Options for this application. Implementers should use Pax Exam's CoreOptions.composite(Option...) to combine multiple options into one if needed.
      Specified by:
      get in interface ApplicationOptions
      Specified by:
      get in interface Supplier<org.ops4j.pax.exam.Option>
      Overrides:
      get in class DdfBaseOptions
      Returns:
      Pax Exam configuration Options
    • getDistributionOptions

      protected org.ops4j.pax.exam.Option getDistributionOptions()
      Description copied from class: DdfBaseOptions
      Gets the distribution artifact to deploy in the Pax Exam container, e.g., the Karaf or DDF distribution zip file.
      Specified by:
      getDistributionOptions in class DdfBaseOptions
      Returns:
      distribution artifact to deploy