repositoryAdmin.removeRepository(repo.getURI());
}
repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());
AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
//installing requires a valid url for the bundle in repository.xml.
app = manager.resolve(app);
DeploymentMetadata depMeta = app.getDeploymentMetadata();
List<DeploymentContent> provision = depMeta.getApplicationProvisionBundles();
assertEquals(provision.toString(), 3, provision.size());
List<String> bundleSymbolicNames = new ArrayList<String>();
for (DeploymentContent dep : provision) {
bundleSymbolicNames.add(dep.getContentName());
}
assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_REFERENCE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_REFERENCE));
assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_VALUE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_VALUE));
assertTrue("Bundle " + BUNDLE_IN_FRAMEWORK + " not found.", bundleSymbolicNames.contains(BUNDLE_IN_FRAMEWORK));
AriesApplicationContext ctx = manager.install(app);
ctx.start();
Set<Bundle> bundles = ctx.getApplicationContent();
assertEquals("Number of bundles provisioned in the app", 4, bundles.size());
ctx.stop();
manager.uninstall(ctx);
}