modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppBundlerTest.java
Print this page
@@ -758,10 +758,42 @@
validateSignatures(output);
}
}
/**
+ * Turn on AppCDS
+ */
+ @Test
+ public void testAppCDS() throws IOException, ConfigException, UnsupportedPlatformException {
+ Bundler bundler = new MacAppBundler();
+
+ Map<String, Object> bundleParams = new HashMap<>();
+
+ // not part of the typical setup, for testing
+ bundleParams.put(BUILD_ROOT.getID(), tmpBase);
+ bundleParams.put(VERBOSE.getID(), true);
+
+ bundleParams.put(APP_NAME.getID(), "AppCDSTest");
+ bundleParams.put(IDENTIFIER.getID(), "com.example.appcds.Test");
+ bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
+ bundleParams.put(UNLOCK_COMMERCIAL_FEATURES.getID(), true);
+ bundleParams.put(ENABLE_APP_CDS.getID(), true);
+
+ if (runtimeJdk != null) {
+ bundleParams.put(MAC_RUNTIME.getID(), runtimeJdk);
+ }
+
+ boolean valid = bundler.validate(bundleParams);
+ assertTrue(valid);
+
+ File output = bundler.execute(bundleParams, new File(workDir, "CDSTest"));
+ System.err.println("Bundle at - " + output);
+ assertNotNull(output);
+ assertTrue(output.exists());
+ }
+
+ /**
* Verify a match on too many keys doesn't blow things up
*/
@Test
public void testTooManyKeyMatches() {
Assume.assumeTrue(MacBaseInstallerBundler.findKey("Developer ID Application:", null, true) != null);