Versions Compared

Key

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

...

The Felix framework is tested against the core TCK. The first thing to do is extract the core TCK JAR file, which includes test suites for:

...

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.

...

The important parts are the following settings:

  • -target specifies the bundles containing the tests.
  • -runpath specifies the class path used to run the framework for the tests.
  • -runbundles specifies the bundles to install for the testsbeing tested.
  • -runproperties specifies configuration properties to pass into the framework.

...

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

Testing a Felix bundle

The core TCK tests the framework implementation and its related services. The compendium TCK tests the various non-framework-related specifications, which are implemented as bundles. For the most part, testing a bundle is similar to testing the framework.

Extract the compendium TCK JAR file to access the individual test suites. Since most compendium service specification test suites require security, it is necessary to use another framework implementation to run these tests, such as Equinox. Since the BND files already mention Equinox on their -runpath setting, it is not necessary to edit them to use it, although it is necessary to supply an Equinox JAR file and drop it into the jar/ subdirectory.

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 implementation, 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, \
    jar/org.osgi.impl.service.log-1.3.2.jar;version=file

It is not necessary to change anything else in the BND and it is normal that the -runbundles setting is empty, since there are no additional bundles associated with testing the framework. After editing the BND files, run the tests using:

No Format

source runtests

This will run all test suites for all BND files. To run a specific test suite, do the following:

No Format

java -jar jar/bnd.jar runtests -title osgi.ct <bnd-file>

Where <bnd-file> specifies one or more BND files for the associates test suites to run.

Note
titleBe Aware

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.