OK, so if the test sleeps long enough, a test can run. My plan now is to have a test driver bundle and in the test method, wait for that bundle to close.
Here's the test during sleep code. It runs at least:
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class KarafWithBundleTest {
@Inject
private BundleContext bundleContext;
@Configuration
public Option[] config() {
return new Option[]{karafDistributionConfiguration().frameworkUrl(
maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject())
.karafVersion("2.2.4").name("Apache Karaf"),
mavenBundle("org.agilewiki.jactor", "jactor-api", "0.0.1-SNAPSHOT"),
mavenBundle("org.agilewiki.jactor", "jactor-impl", "0.0.1-SNAPSHOT"),
mavenBundle("org.agilewiki.jactor", "jactor-util", "0.0.1-SNAPSHOT"),
mavenBundle("org.agilewiki.jactor", "jactor-test-iface", "0.0.1-SNAPSHOT"),
mavenBundle("org.agilewiki.jactor", "jactor-test-service", "0.0.1-SNAPSHOT")
};
}
@Test
public void test() throws Exception {
System.out.println("bbbbbbbbbbbbbbbbbbbbbbbbbbb");
Thread.sleep(10000);
System.out.println("ccccccccccccccccccccccccccc");
}
}