Pax Exam allows testing of bundles within an OSGi container (e.g. AEM, Apache Karaf). Pax Exam is usually used in conjunction with JUnit.