BundleMaker { @Deprecated public Bundle installBundle(File f, boolean start) { try { Bundle b = Osgis.install( framework, "file: if (start) { b.start(); } return b; } catch (Exception e) { throw Exceptions.propagateAnnotated("Error starting bundle from "+f, e); } } BundleMaker(@Nonnull ResourceUtils resources);  BundleMaker(@Nonnull Framework f, @Nonnull ResourceUtils resources);  BundleMaker(@Nonnull ManagementContext mgmt); void setDefaultClassForLoading(Class<?> optionalDefaultClassForLoading); File createJarFromClasspathDir(String path); boolean hasOsgiManifest(File f); Manifest getManifest(File f); File copyAddingManifest(File f, Map<String,String> attrs); File copyAddingManifest(File f, Manifest mf); File copyAdding(File f, Map<ZipEntry, ? extends InputStream> entries); File copyAddingAtEnd(File f, Map<ZipEntry, ? extends InputStream> entries); File copyRemoving(File f, final Set<String> itemsToRemove); File copyRemoving(File f, Predicate<? super String> filter); @Deprecated Bundle installBundle(File f, boolean start); File createTempBundle(String nameHint, Manifest mf, Map<ZipEntry, InputStream> files); File createTempBundle(String nameHint, Map<String, String> mf, Map<ZipEntry, InputStream> files); File createTempZip(String nameHint, Map<ZipEntry, InputStream> files);  }
@SuppressWarnings("deprecation") @Test public void testInstallBundle() throws Exception { Map<String, String> manifest = ImmutableMap.of( Attributes.Name.MANIFEST_VERSION.toString(), "1.2.3", Constants.BUNDLE_VERSION, "4.5.6", Constants.BUNDLE_SYMBOLICNAME, "myname"); generatedJar = bundleMaker.copyAddingManifest(emptyJar, manifest); Bundle bundle = bundleMaker.installBundle(generatedJar, false); assertEquals(bundle.getSymbolicName(), "myname"); assertEquals(bundle.getVersion(), new Version("4.5.6")); Bundle bundle2 = Osgis.bundleFinder(mgmt.getOsgiManager().get().getFramework()) .symbolicName("myname") .version("4.5.6") .findUnique() .get(); assertEquals(bundle2, bundle); }