use of org.motechproject.osgi.web.BundleContextWrapper in project motech by motech.
the class BundleContextWrapperBundleIT method testThatBundleContextWrapperReturnsCorrectApplicationContext.
@Test
public void testThatBundleContextWrapperReturnsCorrectApplicationContext() throws InterruptedException {
BundleContextWrapper bundleContextWrapper = new BundleContextWrapper(bundleContext);
Bundle bundle = bundleContext.getBundle();
assertEquals(bundle.getSymbolicName(), bundleContextWrapper.getCurrentBundleSymbolicName());
new Wait(new ContextPublishedWaitCondition(bundleContext), 5000).start();
ApplicationContext applicationContextForCurrentBundle = bundleContextWrapper.getBundleApplicationContext();
assertNotNull(applicationContextForCurrentBundle);
Object testBundleContextWrapper = applicationContextForCurrentBundle.getBean("testBundleContextWrapper");
assertNotNull(testBundleContextWrapper);
}
Aggregations