Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When testing one or more OSGi bundles in their target environment (an implementation of an OSGi container), there are a lot of things that can go wrong, so checking them in an efficient way can save a lot of time, money, and sweat. The main challenge with OSGi integration tests is to keep close enough to developers' usual testing habits (such as using test frameworks like JUnit) while executing the test itself within a properly configured and provisioned OSGi container. Fortunately Spring DM takes up this challenge and provides a testing framework that smoothly fills the gap between OSGi and JUnit.
Section 10.3.1 covers the basics of Spring DM's integration test support through an example based on the data access layer of an enterprise application. We'll see in this section how to check common OSGi features, like the correct package exports for tested bundles and the consumption of registered OSGi services.