changeset 4647:d291e5d9733b

7123392: (launcher) fix MacOSX launcher failures Reviewed-by: phh
author ksrini
date Thu, 05 Jan 2012 10:13:02 -0800
parents 15b5f3ec1c55
children 98564f184614
files test/tools/launcher/ChangeDataModel.sh test/tools/launcher/ExecutionEnvironment.java test/tools/launcher/Test7029048.java test/tools/launcher/TestHelper.java test/tools/launcher/VersionCheck.java
diffstat 5 files changed, 28 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/launcher/ChangeDataModel.sh	Thu Jan 05 09:27:05 2012 +0000
+++ b/test/tools/launcher/ChangeDataModel.sh	Thu Jan 05 10:13:02 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -160,6 +160,15 @@
 		esac
 	;;
 
+        Darwin )
+                ARCH=`uname -m`
+                case "${ARCH}" in
+                        * )
+                        DUALMODE=false;
+                        ;;
+                esac
+        ;;
+
 	* )
 		echo "Warning: unknown environment."
 		DUALMODE=false
--- a/test/tools/launcher/ExecutionEnvironment.java	Thu Jan 05 09:27:05 2012 +0000
+++ b/test/tools/launcher/ExecutionEnvironment.java	Thu Jan 05 10:13:02 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,9 @@
 
 
 public class ExecutionEnvironment {
-    static final String LD_LIBRARY_PATH    = "LD_LIBRARY_PATH";
+    static final String LD_LIBRARY_PATH    = TestHelper.isMacOSX
+            ? "DYLD_LIBRARY_PATH"
+            : "LD_LIBRARY_PATH";
     static final String LD_LIBRARY_PATH_32 = LD_LIBRARY_PATH + "_32";
     static final String LD_LIBRARY_PATH_64 = LD_LIBRARY_PATH + "_64";
 
@@ -84,7 +86,9 @@
     static int errors = 0;
     static int passes = 0;
 
-    static final String LIBJVM = TestHelper.isWindows ? "jvm.dll" : "libjvm.so";
+    static final String LIBJVM = TestHelper.isWindows
+            ? "jvm.dll"
+            : "libjvm" + (TestHelper.isMacOSX ? ".dylib" : ".so");
 
     static void createTestJar() {
         try {
@@ -180,7 +184,7 @@
 
         Map<String, String> env = new HashMap<String, String>();
 
-        if (TestHelper.isLinux) {
+        if (TestHelper.isLinux || TestHelper.isMacOSX) {
             for (String x : LD_PATH_STRINGS) {
                 String pairs[] = x.split("=");
                 env.put(pairs[0], pairs[1]);
@@ -299,7 +303,7 @@
 
         if (TestHelper.is32Bit) {
             tr = TestHelper.doExec(TestHelper.javaCmd, "-client", "-version");
-            if (!tr.matches("Java.*Client VM.*")) {
+            if (!tr.matches(".*Client VM.*")) {
                 System.out.println("FAIL: the expected vm -client did launch");
                 System.out.println(tr);
                 errors++;
@@ -308,7 +312,7 @@
             }
         }
         tr = TestHelper.doExec(TestHelper.javaCmd, "-server", "-version");
-        if (!tr.matches("Java.*Server VM.*")) {
+        if (!tr.matches(".*Server VM.*")) {
             System.out.println("FAIL: the expected vm -server did launch");
             System.out.println(tr);
             errors++;
--- a/test/tools/launcher/Test7029048.java	Thu Jan 05 09:27:05 2012 +0000
+++ b/test/tools/launcher/Test7029048.java	Thu Jan 05 10:13:02 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -285,8 +285,8 @@
     }
 
     public static void main(String... args) throws Exception {
-        if (TestHelper.isWindows) {
-            System.out.println("Warning: noop on windows");
+        if (TestHelper.isWindows || TestHelper.isMacOSX) {
+            System.out.println("Note: not applicable on Windows and MacOSX");
             return;
         }
         // create our test jar first
--- a/test/tools/launcher/TestHelper.java	Thu Jan 05 09:27:05 2012 +0000
+++ b/test/tools/launcher/TestHelper.java	Thu Jan 05 10:13:02 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,8 @@
     static final boolean debug = Boolean.getBoolean("TestHelper.Debug");
     static final boolean isWindows =
             System.getProperty("os.name", "unknown").startsWith("Windows");
+    static final boolean isMacOSX =
+            System.getProperty("os.name", "unknown").startsWith("Mac");
     static final boolean is64Bit =
             System.getProperty("sun.arch.data.model").equals("64");
     static final boolean is32Bit =
--- a/test/tools/launcher/VersionCheck.java	Thu Jan 05 09:27:05 2012 +0000
+++ b/test/tools/launcher/VersionCheck.java	Thu Jan 05 10:13:02 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -132,7 +132,7 @@
         StringBuilder out = new StringBuilder();
         // remove the HotSpot line
         for (String x : alist) {
-            if (!x.contains("HotSpot")) {
+            if (!x.contains("HotSpot") && !x.contains("VM")) {
                 out = out.append(x + "\n");
             }
         }