OSGi testing without step that package packages

I tested several test solutions for OSGI, including PAX, and quickly looked at the abstract TestCase within Spring DM, but both of them seem to require one of them to assemble and bundle related packages. I was hoping to find something that works without this intermediate step.

Imagine the possibility of package packages on the way to classes, so that packages x and y make up the package XY and packages x and z make up the package XZ. Bundle XZ will not "see" package "y", but can import a service from XY living in package x. Any comments, if possible, or if an equivalent test file / library exists?

+4
source share
2 answers

I think using the OPS4J Tiny Bundles with the Pax exam is what you are looking for.

http://wiki.ops4j.org/display/paxexam/ExamAndTinybundles

+5
source

If you really want to enforce runtime visibility rules than you probably have to run tests inside the OSGi environment and pay some performance overhead.

However, it may be enough for you to ensure compile-time visibility by dividing your classes into separate compilation units (e.g., separate Maven X, Y, Z modules) with the appropriate dependencies, and then running a standard testing environment (e.g. JUnit) without OSGi.

+1
source

All Articles