Package org.apache.sling.testing.paxexam
Class TestSupport
java.lang.Object
org.apache.sling.testing.paxexam.TestSupport
Test Support for OPS4J Pax Exam.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.osgi.service.cm.ConfigurationAdmin -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.ops4j.pax.exam.options.ModifiableCompositeOptionProvides base property and provisioning options for default mode.static org.ops4j.pax.exam.options.UrlProvisionOptionbuildBundleWithBnd(Class... classes) Builds an OSGi bundle with bnd from given classes and provides it as provisioning option.protected org.ops4j.pax.exam.options.ModifiableCompositeOptionProvides commons property and provisioning options for both default and server mode.static org.ops4j.pax.exam.options.SystemPropertyOptionProvides an option to set the System propertypax.exam.osgi.unresolved.failto"true".static intFinds a free local port.protected inthttpPort()Provides Felix HTTP Service's HTTP port (org.osgi.service.http.port).protected org.ops4j.pax.exam.options.OptionalCompositeOptionjacoco()Provides the Jacoco VM option when System propertyjacoco.commandis set.static org.ops4j.pax.exam.options.OptionalCompositeOptionReads the System propertymaven.repo.localand provides an option to set the System propertyorg.ops4j.pax.url.mvn.localRepositorywhen former is not empty.protected org.ops4j.pax.exam.options.ModifiableCompositeOptionProvides base property and provisioning options for server mode.static org.ops4j.pax.exam.options.UrlProvisionOptiontestBundle(String systemProperty) Reads the pathname of the test bundle from the given System property and provides a provisioning option.protected StringProvides a random path for a working directory below Maven's build target directory.
-
Field Details
-
configurationAdmin
@Inject protected org.osgi.service.cm.ConfigurationAdmin configurationAdmin
-
-
Constructor Details
-
TestSupport
public TestSupport()
-
-
Method Details
-
workingDirectory
Provides a random path for a working directory below Maven's build target directory.- Returns:
- the absolute path for working directory
-
httpPort
Provides Felix HTTP Service's HTTP port (org.osgi.service.http.port).- Returns:
- the HTTP port
- Throws:
IOException- if reading OSGi configuration fails
-
jacoco
protected org.ops4j.pax.exam.options.OptionalCompositeOption jacoco()Provides the Jacoco VM option when System propertyjacoco.commandis set.- Returns:
- the property option
-
commonConfiguration
protected org.ops4j.pax.exam.options.ModifiableCompositeOption commonConfiguration()Provides commons property and provisioning options for both default and server mode.- Returns:
- the composite option
-
baseConfiguration
protected org.ops4j.pax.exam.options.ModifiableCompositeOption baseConfiguration()Provides base property and provisioning options for default mode.- Returns:
- the composite option
-
serverBaseConfiguration
protected org.ops4j.pax.exam.options.ModifiableCompositeOption serverBaseConfiguration()Provides base property and provisioning options for server mode.- Returns:
- the composite option
-
findFreePort
public static int findFreePort()Finds a free local port.- Returns:
- the free local port
-
failOnUnresolvedBundles
public static org.ops4j.pax.exam.options.SystemPropertyOption failOnUnresolvedBundles()Provides an option to set the System propertypax.exam.osgi.unresolved.failto"true".- Returns:
- the property option
-
localMavenRepo
public static org.ops4j.pax.exam.options.OptionalCompositeOption localMavenRepo()Reads the System propertymaven.repo.localand provides an option to set the System propertyorg.ops4j.pax.url.mvn.localRepositorywhen former is not empty.- Returns:
- the property option
-
testBundle
Reads the pathname of the test bundle from the given System property and provides a provisioning option.- Parameters:
systemProperty- the System property which contains the pathname of the test bundle- Returns:
- the provisioning option
-
buildBundleWithBnd
Builds an OSGi bundle with bnd from given classes and provides it as provisioning option.- Parameters:
classes- the classes to include in the OSGi bundle- Returns:
- the provisioning option
-