public File createTempZip(String nameHint, Map<ZipEntry, InputStream> files) { return createTempBundle(nameHint, (Manifest)null, files); }
public File createTempBundle(String nameHint, Map<String, String> mf, Map<ZipEntry, InputStream> files) { return createTempBundle(nameHint, manifestOf(mf), files); }
@Test public void testCreate() 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.createTempBundle("test", manifest, ImmutableMap.of(new ZipEntry("myfile.txt"), new ByteArrayInputStream("mytext".getBytes()))); assertJarContents(generatedJar, ImmutableMap.of("myfile.txt", "mytext"), true); @SuppressWarnings("deprecation") Bundle bundle = bundleMaker.installBundle(generatedJar, false); assertEquals(bundle.getSymbolicName(), "myname"); assertEquals(bundle.getVersion(), new Version("4.5.6")); }
File bf = bm.createTempBundle(vn.getSymbolicName(), mf, MutableMap.of( new ZipEntry(CATALOG_BOM), (InputStream) new ByteArrayInputStream(yaml.getBytes())) );