@Test
public void testCompositeLifeCycle() {
BundleTrackerCustomizer customizer = Skeleton.newMock(BundleTrackerCustomizer.class);
InternalRecursiveBundleTracker sut = new InternalRecursiveBundleTracker(context,
Bundle.INSTALLED | Bundle.STARTING | Bundle.ACTIVE | Bundle.STOPPING, customizer);
sut.open();
CompositeBundle cb = Skeleton.newMock(CompositeBundle.class);
Skeleton cbSkel = Skeleton.getSkeleton(cb);
cbSkel.setReturnValue(new MethodCall(CompositeBundle.class, "getSymbolicName"), "test.composite");
cbSkel.setReturnValue(new MethodCall(CompositeBundle.class, "getVersion"), new Version("1.0.0"));
assertTrue(BundleTrackerFactory.getAllBundleTracker().isEmpty());
sut.addingBundle(cb, new BundleEvent(BundleEvent.INSTALLED, cb));
assertEquals(1, BundleTrackerFactory.getAllBundleTracker().size());
assertEquals(1, BundleTrackerFactory.getBundleTrackerList("test.composite_1.0.0").size());
sut.removedBundle(cb, new BundleEvent(BundleEvent.STOPPED, cb), cb);
assertTrue(BundleTrackerFactory.getAllBundleTracker().isEmpty());
}