Chapter 8. Tools for building and testing

 

This chapter covers

  • Strategies for building OSGi bundles
  • How to choose a set of tools that works for you
  • Useful command-line OSGi tools
  • Using Maven and Ant to build OSGi bundles and EBA applications
  • How to unit test OSGi bundles
  • How to run tests on bundles inside an OSGi framework

As you’ve been working through the OSGi examples in this book, we’ve cheerfully assumed that you didn’t need much help building your example bundles. After all, an OSGi bundle is a JAR with some extra metadata, and even an enterprise OSGi bundle is only an OSGi bundle with even more extra metadata. But just because you can build OSGi bundles the same way that you build ordinary JARs doesn’t mean you should. A lot of specialist tools are out there that can make the process of building your OSGi application easier and more robust.

With a few notable exceptions, most of the tools we’ll discuss aren’t specific to enterprise OSGi. This is partly because you don’t necessarily need enterprise tools—the most important thing is support for core OSGi concepts like compile classpath and launching an OSGi framework. A second reason we don’t cover many enterprise OSGi tools is that enterprise OSGi itself is new, and the tools are still catching up!

8.1. Manifest-first or code-first?

8.2. Building OSGi applications

8.3. Testing OSGi applications

8.4. Collecting coverage data

8.5. Summary