Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The OSGi Alliance now provides access to Apache committers access to its Compliance Tests (CT). This page describes how to use run the CT with Felix subprojects against the CT.

OSGi CT Overview

The CT is delivered as two JAR files, one for the core CT and one for the compendium CT. Each JAR file is comprised composed of several other JAR files, which are the actual compliance tests. Typically, there is one JAR per specification, except for the OSGi framework.

...

Modifying the BND files is fairly straightforward, if not tedious. A typical BND file looks like this:

...

No Format
-runpath = \
    /path/to/felix/framework/org.apache.felix.framework-2.0.2.jar;version=file, \
    jar/com.springsource.junit-3.8.2.jar;version=file;export="junit.framework;version=3.8"

It Typically, it is not necessary to change anything else in the BND files and it is normal that the -runbundles setting is empty, since there are no additional bundles associated with testing the framework. The exception to this is for the framework test suites for security, for which you will need to add the framework security provider in -runbundles like this:

No Format

-runbundles = \
    /path/to/felix/framework.security/org.apache.felix.framework.security-1.0.0.jar.jar;version=file

After editing the BND files, run the tests using:

...

Note
titleBe Aware

Tests for native code loading will fail on Java 6, so do not use this JDK for testing the framework. Also, since the Felix framework does not fully implement the security-related portions of the OSGi specification, it is normal for it to fail the security-related test suites.

Reports for the tests suites are generated in the reports/ subdirectory and are named after the appropriate test suite.

...

Extract the compendium CT JAR file to access the individual test suites. Since most compendium service specification test suites require security, it is necessary to use a framework implementation that supports security to run these tests. To test with felix and security enabled. For the Felix framework, you will have to add the security provider to the -runbundles (see the below example). to enable security.

To test a bundle, the -runbundles setting must be modified to refer to the bundle or bundles being tested. For example, to test Felix' Event Admin implementationbundle, edit the -runbundles setting in org.osgi.test.cases.event.bnd to look something like this:

No Format
-runbundles = \
    /path/to/felix/eventadmin/org.apache.felix.eventadmin-1.0.0.jar;version=file,\
    /path/to/felix/framework.security/org.apache.felix.framework.security-1.0.0.jar.jar;version=file

After editing the BND files to refer to the appropriate bundles, run the tests using:

...