You are previewing JUnit in Action, Second Edition.

JUnit in Action, Second Edition

Cover of JUnit in Action, Second Edition by Petar Tahchiev... Published by Manning Publications
O'Reilly logo

Chapter 16. Testing OSGi components

Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: Nothing works and they don’t know why.


This chapter covers

  • The OSGi dynamic module system
  • Mock testing of your modules
  • In-container testing of your modules

So far, we’ve been testing everything from the Java EE spec. All the Java EE components that we’ve dealt with (JSPs, tag libraries, servlets, filters, EJBs, and so on) have been available for a long time. In this chapter we discuss a technology that became popular relatively recently and is getting more popular every day: OSGi.

We start the chapter by introducing OSGi[1] We then walk ...

The best content for your career. Discover unlimited learning on demand for around $1/day.