public class DdfComponentOptions extends DdfBaseOptions
Option
s 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>
DdfBaseOptions
,
KarafOptions
ROOT_CONTEXT, SERVLET_CONTEXT_KEY
Constructor and Description |
---|
DdfComponentOptions(PortFinder portFinder)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.ops4j.pax.exam.Option |
get()
Gets the Pax Exam configuration
Option s for this application. |
protected org.ops4j.pax.exam.Option |
getDistributionOptions()
Gets the distribution artifact to deploy in the Pax Exam container, e.g., the Karaf or DDF
distribution zip file.
|
getBundleOptions, getDefaultLogPackages, getExtraOptions, getFeatureOptions
public DdfComponentOptions(PortFinder portFinder)
portFinder
- instance of the PortFinder
to use to assign unique ports to the new
Pax Exam containerpublic org.ops4j.pax.exam.Option get()
ApplicationOptions
Option
s for this application. Implementers should use
Pax Exam's CoreOptions.composite(Option...)
to combine multiple
options into one if needed.get
in interface Supplier<org.ops4j.pax.exam.Option>
get
in interface ApplicationOptions
get
in class DdfBaseOptions
Option
sprotected org.ops4j.pax.exam.Option getDistributionOptions()
DdfBaseOptions
getDistributionOptions
in class DdfBaseOptions
This work is licensed under a Creative Commons Attribution 4.0 International License.