--- old/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinExeBundlerTest.java 2015-03-30 15:12:23.000000000 -0600 +++ new/modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinExeBundlerTest.java 2015-03-30 15:12:22.000000000 -0600 @@ -63,6 +63,8 @@ static File workDir; static File appResourcesDir; static File fakeMainJar; + static String runtimeJdk; + static String runtimeJre; static Set appResources; static boolean retain = false; @@ -71,6 +73,9 @@ // only run on windows Assume.assumeTrue(System.getProperty("os.name").toLowerCase().startsWith("win")); + runtimeJdk = System.getenv("PACKAGER_JDK_ROOT"); + runtimeJre = System.getenv("PACKAGER_JRE_ROOT"); + // only run if we have InnoSetup installed Assume.assumeNotNull(WinExeBundler.TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(new HashMap<>())); @@ -511,4 +516,36 @@ assertNotNull(result); assertTrue(result.exists()); } + + /** + * Turn on AppCDS + */ + @Test + public void testAppCDS() throws IOException, ConfigException, UnsupportedPlatformException { + Bundler bundler = new WinExeBundler(); + + Map bundleParams = new HashMap<>(); + + // not part of the typical setup, for testing + bundleParams.put(BUILD_ROOT.getID(), tmpBase); + bundleParams.put(VERBOSE.getID(), true); + if (runtimeJdk != null) { + bundleParams.put(WIN_RUNTIME.getID(), runtimeJdk); + } + + bundleParams.put(APP_NAME.getID(), "AppCDS"); + bundleParams.put(IDENTIFIER.getID(), "com.example.appcds.exe.Test"); + bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources)); + bundleParams.put(UNLOCK_COMMERCIAL_FEATURES.getID(), true); + bundleParams.put(ENABLE_APP_CDS.getID(), true); + + 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()); + } + }