Home » Documentation » Apache Felix Subproject Documentation » Apache Felix Sigil » Sigil User Guide

Sigil JUnit


The Sigil JUnit plugin is an OSGi bundle that when started in an OSGi enabled JVM watches for other bundles that contain JUnit TestCase classes in the framework. The main access point to the plugin is the org.cauldron.sigil.junit.server.JUnitService.

package org.cauldron.sigil.junit.server; import java.util.Set; import org.osgi.framework.BundleContext; import junit.framework.TestSuite; /** * */ public interface JUnitService { /** * Returns the names of all tests currently installed in the OSGi runtime */ Set getTests(); /** * Create a new instance of the specified test. Equivalent to calling createTest(test, null); */ TestSuite createTest(String test); /** * Create a new instance of the specified test passing the specified bundle context to the test classes. * If ctx is null the callers BundleContext is passed to the test. */ TestSuite createTest(String test, BundleContext ctx); } When a test is created the `JUnitService` introspects the test class and looks for a method `public void setBundleContext(BundleContext ctx);` if one is found then the BundleContext is injected into the test class before being returned to the caller.
Rev. 1700393 by cziegeler on Tue, 1 Sep 2015 06:04:06 +0000
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.