URI uri = createTempRepo("<features name='test' xmlns='http://karaf.apache.org/xmlns/features/v1.0.0'>"
+ " <feature name='f1' version='0.1'><feature version='0.1'>f2</feature><bundle>bundle-f1-0.1</bundle></feature>"
+ " <feature name='f2' version='0.1'><bundle>bundle-f2-0.1</bundle></feature>"
+ "</features>");
BundleManager bundleManager = EasyMock.createMock(BundleManager.class);
BundleContext bundleContext = EasyMock.createMock(BundleContext.class);
Bundle bundlef101 = createDummyBundle(12345L, "bundle-f1-0.1", headers());
Bundle bundlef201 = createDummyBundle(54321L, "bundle-f2-0.1", headers());
expect(bundleManager.getDataFile(EasyMock.<String> anyObject())).andReturn(dataFile).anyTimes();
expect(bundleManager.installBundleIfNeeded("bundle-f1-0.1", 0, null))
.andReturn(new BundleInstallerResult(bundlef101, true));
expect(bundleManager.installBundleIfNeeded("bundle-f2-0.1", 0, null))
.andReturn(new BundleInstallerResult(bundlef201, true));
expect(bundleManager.getBundleContext()).andReturn(bundleContext).anyTimes();
expect(bundleContext.getBundle(12345)).andReturn(bundlef101).anyTimes();
ignoreRefreshes(bundleManager);
bundleManager.uninstall(Collections.EMPTY_LIST, true);
EasyMock.expectLastCall().anyTimes();
replay(bundleManager);
FeaturesServiceImpl svc = new FeaturesServiceImpl(bundleManager);