String location = f.toURI().normalize().toString();
Map<String, String> configuration = new HashMap<String, String>();
configuration.put(Constants.FRAMEWORK_STORAGE, "target/papoose");
final FrameworkFactory factory = new PapooseFrameworkFactory();
Framework framework = factory.newFramework(configuration);
framework.init();
Bundle systemBundle = framework.getBundleContext().getBundle(0);
BundleContext context = systemBundle.getBundleContext();
Bundle testBundle = context.installBundle(location);
long testBundleId = testBundle.getBundleId();
assertTrue(testBundleId > 0);
try
{
framework.uninstall();
fail("Should have thrown an exception");
}
catch (BundleException e)
{
}
framework.stop();
framework = factory.newFramework(configuration);
framework.init();
systemBundle = framework.getBundleContext().getBundle(0);
context = systemBundle.getBundleContext();