Slide 47
Slide 47 text
© msg Applied Technology Research, 01.07.2013
Markus Eisele - @myfear - http://blog.eisele.net
47
@Test
public void testBundleContextInjection() {
assertNotNull("BundleContext injected", context);
assertEquals("System Bundle ID", 0, context.getBundle().getBundleId());
}
@Test
public void testBundleInjection(@ArquillianResource Bundle bundle) {
// Assert that the bundle is injected
assertNotNull("Bundle injected", bundle);
// Assert that the bundle is in state RESOLVED
// Note when the test bundle contains the test case it
// must be resolved already when this test method is called
assertEquals("Bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
// Start the bundle
bundle.start();
assertEquals("Bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
https://github.com/arquillian/arquillian-container-osgi