use of org.apache.aries.application.management.spi.resolve.AriesApplicationResolver in project aries by apache.
the class OBRResolverTest method createAndResolveSelfContainedApp.
private Collection<ModelledResource> createAndResolveSelfContainedApp(String extraImport) throws Exception {
FileOutputStream fout = new FileOutputStream(new File("a.bundle.jar"));
ArchiveFixture.newJar().manifest().attribute(BUNDLE_SYMBOLICNAME, "a.bundle").attribute(BUNDLE_VERSION, "1.0.0").attribute(BUNDLE_MANIFESTVERSION, "2").attribute(IMPORT_PACKAGE, "a.pack.age").end().writeOut(fout);
fout.close();
fout = new FileOutputStream(new File("b.bundle.jar"));
ArchiveFixture.newJar().manifest().attribute(BUNDLE_SYMBOLICNAME, "b.bundle").attribute(BUNDLE_VERSION, "1.0.0").attribute(BUNDLE_MANIFESTVERSION, "2").attribute(IMPORT_PACKAGE, extraImport).attribute(EXPORT_PACKAGE, "a.pack.age").end().writeOut(fout);
fout.close();
ModelledResourceManager mrm = context().getService(ModelledResourceManager.class);
ModelledResource aBundle = mrm.getModelledResource(FileSystem.getFSRoot(new File("a.bundle.jar")));
ModelledResource bBundle = mrm.getModelledResource(FileSystem.getFSRoot(new File("b.bundle.jar")));
AriesApplicationResolver resolver = context().getService(AriesApplicationResolver.class);
return resolver.resolveInIsolation("test.app", "1.0.0", Arrays.asList(aBundle, bBundle), Arrays.<Content>asList(ContentFactory.parseContent("a.bundle", "1.0.0"), ContentFactory.parseContent("b.bundle", "1.0.0")));
}
Aggregations