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
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:
-
Field Summary
Fields inherited from class org.codice.ddf.test.common.configurators.DdfBaseOptions
ROOT_CONTEXT, SERVLET_CONTEXT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.ops4j.pax.exam.Optionget()Gets the Pax Exam configurationOptions for this application.protected org.ops4j.pax.exam.OptionGets the distribution artifact to deploy in the Pax Exam container, e.g., the Karaf or DDF distribution zip file.Methods inherited from class org.codice.ddf.test.common.configurators.DdfBaseOptions
getBundleOptions, getDefaultLogPackages, getExtraOptions, getFeatureOptions, installStartupFile
-
Constructor Details
-
DdfComponentOptions
Constructor.- Parameters:
portFinder- instance of thePortFinderto 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:ApplicationOptionsGets the Pax Exam configurationOptions for this application. Implementers should use Pax Exam'sCoreOptions.composite(Option...)to combine multiple options into one if needed.- Specified by:
getin interfaceApplicationOptions- Specified by:
getin interfaceSupplier<org.ops4j.pax.exam.Option>- Overrides:
getin classDdfBaseOptions- Returns:
- Pax Exam configuration
Options
-
getDistributionOptions
protected org.ops4j.pax.exam.Option getDistributionOptions()Description copied from class:DdfBaseOptionsGets the distribution artifact to deploy in the Pax Exam container, e.g., the Karaf or DDF distribution zip file.- Specified by:
getDistributionOptionsin classDdfBaseOptions- Returns:
- distribution artifact to deploy
-