How to specify system package exports in pax exam

475 views Asked by At

Pax exam is used to test Apache CXF Distributed OSGi. I recently updated to apache felix 4.2.1. In the newer version of felix I get problems with packages exported by cxf spec bundles and the system bundle. No idea why this did not occur with the older felix 3.x.

For the distribution we control this in the felix config (see the config template we use) There we use the "org.osgi.framework.system.packages" property to define the system package exports.

How can I do the same using pax exam. I know how to do this using karaf exam but it can not be used as we want to explicitly test against pure felix.

I already tested CoreOptions.systemPackage but it only allows to add exports not to redefine them.

2

There are 2 answers

0
Christian Schneider On

Got an answer from the ops4j list: CoreOptions.frameworkProperty("org.osgi.framework.system.packages").value(sysPackages)

The option works on Eclipse Equinox but not on Apache Felix.

0
Roland On

Pax Exam 3

 Option[] conf = options(
    systemProperty("org.osgi.framework.startlevel.beginning").value("4"),
    systemPackages(
        "com.ibm.uvm.tools",
        "com.sun.jdmk.comm",
        "sun.misc",
        "javax.jmdns",
        "javax.microedition.io",
        "javax.servlet.http",
        "javax.persistence",
        "javax.servlet",
        "javax.net.ssl",
        "javax.jms",
        "javax.mail",
        "javax.mail.internet",
        "javax.mail.util"),
     ...);

Regards Roland