publicvoid test() throws Exception {
ResourcePoolManager input = new ResourcePoolManager(); // need java.base module info because OS name is retrieved from it from storeFiles
input.add(ResourcePoolEntryFactory.create("/java.base/module-info.class",
ResourcePoolEntry.Type.CLASS_OR_RESOURCE, getJavaBaseModuleInfo()));
// same NATIVE_CMD from two different modules
input.add(newInMemoryImageFile("/com.acme/bin/myexec",
ResourcePoolEntry.Type.NATIVE_CMD, "mylib"));
input.add(newInMemoryImageFile("/com.foo/bin/myexec",
ResourcePoolEntry.Type.NATIVE_CMD, "mylib"));
Path root = Paths.get(System.getProperty("test.classes"));
DefaultImageBuilder writer = new DefaultImageBuilder(root, Collections.emptyMap()); try {
writer.storeFiles(input.resourcePool());
} catch (PluginException pe) { if (! pe.getMessage().contains("Duplicate resources:")) { thrownew AssertionError("expected duplicate resources message");
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.