changeset 7757:fb4402463363

RT-37439: Install packaged JDK and JRE on Mac Build Servers Summary: Fix typing errors.
author shemnon
date Thu, 21 Aug 2014 19:53:02 -0600
parents 607e673d8907
children 3abdf4d4ac34
files modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppStoreBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDaemonBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDmgBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacPkgBundlerTest.java
diffstat 5 files changed, 24 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppBundlerTest.java	Fri Aug 22 11:13:58 2014 +1200
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppBundlerTest.java	Thu Aug 21 19:53:02 2014 -0600
@@ -61,8 +61,8 @@
     static File appResourcesDir;
     static File fakeMainJar;
     static File hdpiIcon;
-    static File runtimeJdk;
-    static File runtimeJre;
+    static String runtimeJdk;
+    static String runtimeJre;
     static Set<File> appResources;
     static boolean retain = false;
 
@@ -71,15 +71,12 @@
         // only run on mac
         Assume.assumeTrue(System.getProperty("os.name").toLowerCase().contains("os x"));
 
-        String packagerJdkRoot = System.getenv("PACKAGER_JDK_ROOT");
-        runtimeJdk = packagerJdkRoot == null ? null : new File(packagerJdkRoot);
-
-        String packagerJreRoot = System.getenv("PACKAGER_JRE_ROOT");
-        runtimeJre = packagerJreRoot == null ? null : new File(packagerJreRoot);
+        runtimeJdk = System.getenv("PACKAGER_JDK_ROOT");
+        runtimeJre = System.getenv("PACKAGER_JRE_ROOT");
 
         // and only if we have the correct JRE settings
         String jre = System.getProperty("java.home").toLowerCase();
-        Assume.assumeTrue(packagerJdkRoot != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
+        Assume.assumeTrue(runtimeJdk != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
 
         Log.setLogger(new Log.Logger(true));
 
@@ -447,8 +444,8 @@
      */
     @Test(expected = ConfigException.class)
     public void testJRE() throws IOException, ConfigException, UnsupportedPlatformException {
-        File jre = runtimeJre == null ? new File("/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/") : runtimeJre;
-        Assume.assumeTrue(jre.isDirectory());
+        String jre = runtimeJre == null ? "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/" : runtimeJre;
+        Assume.assumeTrue(new File(jre).isDirectory());
 
         Bundler bundler = new MacAppBundler();
 
@@ -458,7 +455,7 @@
         bundleParams.put(BUILD_ROOT.getID(), tmpBase);
 
         bundleParams.put(APP_RESOURCES.getID(), new RelativeFileSet(appResourcesDir, appResources));
-        bundleParams.put(MAC_RUNTIME.getID(), jre.toString());
+        bundleParams.put(MAC_RUNTIME.getID(), jre);
 
         boolean valid = bundler.validate(bundleParams);
         assertTrue(valid);
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppStoreBundlerTest.java	Fri Aug 22 11:13:58 2014 +1200
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppStoreBundlerTest.java	Thu Aug 21 19:53:02 2014 -0600
@@ -66,8 +66,8 @@
     static File appResourcesDir;
     static File fakeMainJar;
     static File hdpiIcon;
-    static File runtimeJdk;
-    static File runtimeJre;
+    static String runtimeJdk;
+    static String runtimeJre;
     static Set<File> appResources;
     static boolean retain = false;
 
@@ -76,15 +76,12 @@
         // only run on mac
         Assume.assumeTrue(System.getProperty("os.name").toLowerCase().contains("os x"));
 
-        String packagerJdkRoot = System.getenv("PACKAGER_JDK_ROOT");
-        runtimeJdk = packagerJdkRoot == null ? null : new File(packagerJdkRoot);
-
-        String packagerJreRoot = System.getenv("PACKAGER_JRE_ROOT");
-        runtimeJre = packagerJreRoot == null ? null : new File(packagerJreRoot);
+        runtimeJdk = System.getenv("PACKAGER_JDK_ROOT");
+        runtimeJre = System.getenv("PACKAGER_JRE_ROOT");
 
         // and only if we have the correct JRE settings
         String jre = System.getProperty("java.home").toLowerCase();
-        Assume.assumeTrue(packagerJdkRoot != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
+        Assume.assumeTrue(runtimeJdk != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
 
         // make sure we have a default signing key
         String signingKeyName = MacAppStoreBundler.MAC_APP_STORE_APP_SIGNING_KEY.fetchFrom(new TreeMap<>());
@@ -294,9 +291,8 @@
      */
     @Test(expected = ConfigException.class)
     public void testJRE() throws IOException, ConfigException, UnsupportedPlatformException {
-
-        File jre = runtimeJre == null ? new File("/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/") : runtimeJre;
-        Assume.assumeTrue(jre.isDirectory());
+        String jre = runtimeJre == null ? "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/" : runtimeJre;
+        Assume.assumeTrue(new File(jre).isDirectory());
 
         AbstractBundler bundler = new MacAppStoreBundler();
 
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDaemonBundlerTest.java	Fri Aug 22 11:13:58 2014 +1200
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDaemonBundlerTest.java	Thu Aug 21 19:53:02 2014 -0600
@@ -56,7 +56,7 @@
 
     static File tmpBase;
     static File workDir;
-    static File runtimeJdk;
+    static String runtimeJdk;
     static boolean retain = false;
 
     @BeforeClass
@@ -64,12 +64,11 @@
         // only run on mac
         Assume.assumeTrue(System.getProperty("os.name").toLowerCase().contains("os x"));
 
-        String packagerJdkRoot = System.getenv("PACKAGER_JDK_ROOT");
-        runtimeJdk = packagerJdkRoot == null ? null : new File(packagerJdkRoot);
+        runtimeJdk = System.getenv("PACKAGER_JDK_ROOT");
 
         // and only if we have the correct JRE settings
         String jre = System.getProperty("java.home").toLowerCase();
-        Assume.assumeTrue(packagerJdkRoot != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
+        Assume.assumeTrue(runtimeJdk != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
 
         Log.setLogger(new Log.Logger(true));
 
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDmgBundlerTest.java	Fri Aug 22 11:13:58 2014 +1200
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDmgBundlerTest.java	Thu Aug 21 19:53:02 2014 -0600
@@ -63,7 +63,7 @@
     static File appResourcesDir;
     static File fakeMainJar;
     static File hdpiIcon;
-    static File runtimeJdk;
+    static String runtimeJdk;
     static Set<File> appResources;
     static boolean retain = false;
     static boolean full_tests = false;
@@ -73,12 +73,11 @@
         // only run on mac
         Assume.assumeTrue(System.getProperty("os.name").toLowerCase().contains("os x"));
 
-        String packagerJdkRoot = System.getenv("PACKAGER_JDK_ROOT");
-        runtimeJdk = packagerJdkRoot == null ? null : new File(packagerJdkRoot);
+        runtimeJdk = System.getenv("PACKAGER_JDK_ROOT");
 
         // and only if we have the correct JRE settings
         String jre = System.getProperty("java.home").toLowerCase();
-        Assume.assumeTrue(packagerJdkRoot != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
+        Assume.assumeTrue(runtimeJdk != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
 
         Log.setLogger(new Log.Logger(true));
         Log.setDebug(true);
--- a/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacPkgBundlerTest.java	Fri Aug 22 11:13:58 2014 +1200
+++ b/modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacPkgBundlerTest.java	Thu Aug 21 19:53:02 2014 -0600
@@ -64,7 +64,7 @@
     static File appResourcesDir;
     static File fakeMainJar;
     static File hdpiIcon;
-    static File runtimeJdk;
+    static String runtimeJdk;
     static Set<File> appResources;
     static boolean retain = false;
 
@@ -73,12 +73,11 @@
         // only run on mac
         Assume.assumeTrue(System.getProperty("os.name").toLowerCase().contains("os x"));
 
-        String packagerJdkRoot = System.getenv("PACKAGER_JDK_ROOT");
-        runtimeJdk = packagerJdkRoot == null ? null : new File(packagerJdkRoot);
+        runtimeJdk = System.getenv("PACKAGER_JDK_ROOT");
 
         // and only if we have the correct JRE settings
         String jre = System.getProperty("java.home").toLowerCase();
-        Assume.assumeTrue(packagerJdkRoot != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
+        Assume.assumeTrue(runtimeJdk != null || jre.endsWith("/contents/home/jre") || jre.endsWith("/contents/home/jre"));
 
         Log.setLogger(new Log.Logger(true));