use of org.apache.aries.blueprint.sample.DestroyTest in project aries by apache.
the class TestReferences method testReferencesCallableInDestroy.
@Test
public void testReferencesCallableInDestroy() throws Exception {
bundleContext.registerService(Runnable.class.getName(), new Thread(), null);
BlueprintContainer blueprintContainer = Helper.getBlueprintContainerForBundle(context(), "org.apache.aries.blueprint.sample");
assertNotNull(blueprintContainer);
DestroyTest dt = (DestroyTest) blueprintContainer.getComponentInstance("destroyCallingReference");
Bundle b = findBundle("org.apache.aries.blueprint.sample");
assertNotNull(b);
b.stop();
assertTrue("The destroy method was called", dt.waitForDestruction(1000));
Exception e = dt.getDestroyFailure();
if (e != null)
throw e;
}
Aggregations