Class DdfBaseOptions
java.lang.Object
org.codice.ddf.test.common.configurators.DdfBaseOptions
- All Implemented Interfaces:
Supplier<org.ops4j.pax.exam.Option>,ApplicationOptions
- Direct Known Subclasses:
DdfComponentOptions
Provides the basic DDF configuration
Options required to run with Pax Exam. The class
must be extended to implement getDistributionOptions() and provide the distribution that
will be run in the test container.
Any other bundles and features required by the tests can be provided by extending this class
and implementing getBundleOptions() and getFeatureOptions(). Other
configuration options can be provided by overwriting getExtraOptions().
The following system properties can be used to customize the application's runtime behavior:
logLevel: sets logging to the level specified for allddfandorg.codice.ddfpackages, unlesslogPackagesis also provided.logPackages: coma-separated list of packageslogLevelwill apply to;ddfandorg.codice.ddfif not provided.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.ops4j.pax.exam.Optionget()Gets the Pax Exam configurationOptions for this application.protected BundleOptionBuilder.BundleOptionGets theBundleOptionBuilder.BundleOptionthat contains all the bundles to start in the Pax Exam container for the tests to run.protected StringGets the list of packages whose logging level will be changed when thelogLevelsystem property has been defined.protected abstract org.ops4j.pax.exam.OptionGets the distribution artifact to deploy in the Pax Exam container, e.g., the Karaf or DDF distribution zip file.protected org.ops4j.pax.exam.OptionGets the extra Pax ExamOptionto use to configure the Pax Exam container.protected FeatureOptionBuilder.FeatureOptionGets theFeatureOptionBuilder.FeatureOptionthat contains all the features to start in the Pax Exam container for the tests to run.protected org.ops4j.pax.exam.OptioninstallStartupFile(URL resource, String destination) Copies the content of a JAR resource to the destination specified before the container starts up.
-
Field Details
-
SERVLET_CONTEXT_KEY
Servlet context system property key- See Also:
-
ROOT_CONTEXT
Root context value- See Also:
-
-
Constructor Details
-
DdfBaseOptions
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>- Returns:
- Pax Exam configuration
Options
-
getDistributionOptions
protected abstract 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.- Returns:
- distribution artifact to deploy
-
getBundleOptions
Gets theBundleOptionBuilder.BundleOptionthat contains all the bundles to start in the Pax Exam container for the tests to run.Important: Since the bundle being tested will automatically be started by this class, it should not be returned by this method.
- Returns:
BundleOptionBuilder.BundleOptionthat contains the bundles to start. Defaults to an empty list of bundles.
-
getFeatureOptions
Gets theFeatureOptionBuilder.FeatureOptionthat contains all the features to start in the Pax Exam container for the tests to run.- Returns:
FeatureOptionBuilder.FeatureOptionthat contains the features to start. Defaults to an empty list of features.
-
getExtraOptions
protected org.ops4j.pax.exam.Option getExtraOptions()Gets the extra Pax ExamOptionto use to configure the Pax Exam container.CoreOptions.composite(Option...)can be used to combine multiple options into one.- Returns:
- extra
Option. Defaults to empty.
-
getDefaultLogPackages
Gets the list of packages whose logging level will be changed when thelogLevelsystem property has been defined. By default, theddfandorg.codice.ddfpackages will have their logging level set to the one specified bylogLevel.- Returns:
- coma-separated list of packages to include by default. Defaults to
ddfandorg.codice.ddf.
-
installStartupFile
Copies the content of a JAR resource to the destination specified before the container starts up. Useful to add test configuration files before tests are run.- Parameters:
resource- URL to the JAR resource to copydestination- destination relative to DDF_HOME- Returns:
- option object
- Throws:
IOException- thrown if a problem occurs while copying the resource
-