Using the OSGi TCK

The OSGi Alliance now provides access to Apache committers to its TCK binaries. This page describes how to use run Felix subprojects against the TCK.

OSGi TCK Overview

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

The TCK uses BND as its testing harness, which in turn uses the OSGi R4.2 framework launching and embedding API to configure, launch, and install test bundles. Each test JAR file has an associated BND file which supplies the configuration BND needs to run the associated tests.

Modifying the BND files

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

# bnd pack for project org.osgi.test.cases.startlevel
# Mon Aug 31 18:50:18 EDT 2009
build=.

-target = \
    jar/org.osgi.test.cases.startlevel-4.2.0.jar;version=file,

-runpath = \
    jar/org.eclipse.osgi-3.5.1.jar;version=file, \
    jar/com.springsource.junit-3.8.2.jar;version=file;export="junit.framework;version=3.8"

-runbundles

-runproperties = \
report="true", \
osgi.compatibility.bootdelegation="false", \
osgi.resolverMode="strict"