TestHelper.java (4428:d17eb3380a49) | TestHelper.java (4887:5e34726cb4bb) |
---|---|
1/* 2 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * --- 35 unchanged lines hidden (view full) --- 44/** 45 * This class provides some common utilities for the launcher tests. 46 */ 47public enum TestHelper { 48 INSTANCE; 49 static final String JAVAHOME = System.getProperty("java.home"); 50 static final boolean isSDK = JAVAHOME.endsWith("jre"); 51 static final String javaCmd; | 1/* 2 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * --- 35 unchanged lines hidden (view full) --- 44/** 45 * This class provides some common utilities for the launcher tests. 46 */ 47public enum TestHelper { 48 INSTANCE; 49 static final String JAVAHOME = System.getProperty("java.home"); 50 static final boolean isSDK = JAVAHOME.endsWith("jre"); 51 static final String javaCmd; |
52 static final String javawCmd; |
|
52 static final String java64Cmd; 53 static final String javacCmd; 54 static final JavaCompiler compiler; 55 56 static final boolean debug = Boolean.getBoolean("TestHelper.Debug"); 57 static final boolean isWindows = 58 System.getProperty("os.name", "unknown").startsWith("Windows"); 59 static final boolean is64Bit = --- 19 unchanged lines hidden (view full) --- 79 compiler = ToolProvider.getSystemJavaCompiler(); 80 File binDir = (isSDK) ? new File((new File(JAVAHOME)).getParentFile(), "bin") 81 : new File(JAVAHOME, "bin"); 82 File javaCmdFile = (isWindows) 83 ? new File(binDir, "java.exe") 84 : new File(binDir, "java"); 85 javaCmd = javaCmdFile.getAbsolutePath(); 86 if (!javaCmdFile.canExecute()) { | 53 static final String java64Cmd; 54 static final String javacCmd; 55 static final JavaCompiler compiler; 56 57 static final boolean debug = Boolean.getBoolean("TestHelper.Debug"); 58 static final boolean isWindows = 59 System.getProperty("os.name", "unknown").startsWith("Windows"); 60 static final boolean is64Bit = --- 19 unchanged lines hidden (view full) --- 80 compiler = ToolProvider.getSystemJavaCompiler(); 81 File binDir = (isSDK) ? new File((new File(JAVAHOME)).getParentFile(), "bin") 82 : new File(JAVAHOME, "bin"); 83 File javaCmdFile = (isWindows) 84 ? new File(binDir, "java.exe") 85 : new File(binDir, "java"); 86 javaCmd = javaCmdFile.getAbsolutePath(); 87 if (!javaCmdFile.canExecute()) { |
87 throw new RuntimeException("java <" + TestHelper.javaCmd + "> must exist"); | 88 throw new RuntimeException("java <" + TestHelper.javaCmd + 89 "> must exist and should be executable"); |
88 } 89 90 File javacCmdFile = (isWindows) 91 ? new File(binDir, "javac.exe") 92 : new File(binDir, "javac"); 93 javacCmd = javacCmdFile.getAbsolutePath(); | 90 } 91 92 File javacCmdFile = (isWindows) 93 ? new File(binDir, "javac.exe") 94 : new File(binDir, "javac"); 95 javacCmd = javacCmdFile.getAbsolutePath(); |
96 97 if (isWindows) { 98 File javawCmdFile = new File(binDir, "javaw.exe"); 99 javawCmd = javawCmdFile.getAbsolutePath(); 100 if (!javawCmdFile.canExecute()) { 101 throw new RuntimeException("java <" + javawCmd + 102 "> must exist and should be executable"); 103 } 104 } else { 105 javawCmd = null; 106 } 107 |
|
94 if (!javacCmdFile.canExecute()) { | 108 if (!javacCmdFile.canExecute()) { |
95 throw new RuntimeException("java <" + javacCmd + "> must exist"); | 109 throw new RuntimeException("java <" + javacCmd + 110 "> must exist and should be executable"); |
96 } 97 if (isSolaris) { 98 File sparc64BinDir = new File(binDir,isSparc ? "sparcv9" : "amd64"); 99 File java64CmdFile= new File(sparc64BinDir, "java"); 100 if (java64CmdFile.exists() && java64CmdFile.canExecute()) { 101 java64Cmd = java64CmdFile.getAbsolutePath(); 102 } else { 103 java64Cmd = null; --- 290 unchanged lines hidden --- | 111 } 112 if (isSolaris) { 113 File sparc64BinDir = new File(binDir,isSparc ? "sparcv9" : "amd64"); 114 File java64CmdFile= new File(sparc64BinDir, "java"); 115 if (java64CmdFile.exists() && java64CmdFile.canExecute()) { 116 java64Cmd = java64CmdFile.getAbsolutePath(); 117 } else { 118 java64Cmd = null; --- 290 unchanged lines hidden --- |