author | herrick |
Mon, 12 Aug 2019 15:27:17 -0400 | |
branch | JDK-8200758-branch |
changeset 57740 | 9b19a9cd651c |
parent 57445 | 405ddd80496e |
child 57742 | e3d4b9bc5093 |
permissions | -rw-r--r-- |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
1 |
/* |
57106
ea870b9ce89a
8216492: Update copyright of all new jpackage fils to 2019
kcr
parents:
57079
diff
changeset
|
2 |
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
4 |
* |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
8 |
* |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
13 |
* accompanied this code). |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
14 |
* |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
18 |
* |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
21 |
* questions. |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
22 |
*/ |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
23 |
|
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
24 |
import java.io.File; |
57407 | 25 |
import java.nio.file.Path; |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
26 |
|
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
27 |
/** |
57407 | 28 |
* Helper class which contains functions to get different system |
29 |
* dependent paths used by tests |
|
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
30 |
*/ |
57039 | 31 |
public class JPackagePath { |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
32 |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
33 |
// Path to Windows "Program Files" folder |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
34 |
// Probably better to figure this out programattically |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
35 |
private static final String WIN_PROGRAM_FILES = "C:\\Program Files"; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
36 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
37 |
// Path to Windows Start menu items |
57407 | 38 |
private static final String WIN_START_MENU = |
39 |
"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs"; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
40 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
41 |
// Path to Windows public desktop location |
57407 | 42 |
private static final String WIN_PUBLIC_DESKTOP = |
43 |
"C:\\Users\\Public\\Desktop"; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
44 |
|
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
45 |
// Return path to test src adjusted to location of caller |
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
46 |
public static String getTestSrcRoot() { |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
47 |
return JPackageHelper.TEST_SRC_ROOT; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
48 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
49 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
50 |
// Return path to calling test |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
51 |
public static String getTestSrc() { |
57039 | 52 |
return JPackageHelper.TEST_SRC; |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
53 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
54 |
|
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
55 |
// Returns path to generate test application |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
56 |
public static String getApp() { |
57395
521c02b9eed0
8224130: create additional automated tests for create-app-image
herrick
parents:
57333
diff
changeset
|
57 |
return getApp("test"); |
521c02b9eed0
8224130: create additional automated tests for create-app-image
herrick
parents:
57333
diff
changeset
|
58 |
} |
521c02b9eed0
8224130: create additional automated tests for create-app-image
herrick
parents:
57333
diff
changeset
|
59 |
|
521c02b9eed0
8224130: create additional automated tests for create-app-image
herrick
parents:
57333
diff
changeset
|
60 |
public static String getApp(String name) { |
57039 | 61 |
if (JPackageHelper.isWindows()) { |
57740 | 62 |
return Path.of("output", name, name + ".exe").toString(); |
57039 | 63 |
} else if (JPackageHelper.isOSX()) { |
57407 | 64 |
return Path.of("output", name + ".app", |
65 |
"Contents", "MacOS", name).toString(); |
|
57039 | 66 |
} else if (JPackageHelper.isLinux()) { |
57407 | 67 |
return Path.of("output", name, "bin", name).toString(); |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
68 |
} else { |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
69 |
throw new AssertionError("Cannot detect platform"); |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
70 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
71 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
72 |
|
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
73 |
// Returns path to generate test application icon |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
74 |
public static String getAppIcon() { |
57395
521c02b9eed0
8224130: create additional automated tests for create-app-image
herrick
parents:
57333
diff
changeset
|
75 |
return getAppIcon("test"); |
521c02b9eed0
8224130: create additional automated tests for create-app-image
herrick
parents:
57333
diff
changeset
|
76 |
} |
521c02b9eed0
8224130: create additional automated tests for create-app-image
herrick
parents:
57333
diff
changeset
|
77 |
|
521c02b9eed0
8224130: create additional automated tests for create-app-image
herrick
parents:
57333
diff
changeset
|
78 |
public static String getAppIcon(String name) { |
57039 | 79 |
if (JPackageHelper.isWindows()) { |
57740 | 80 |
return Path.of("output", name, name + ".ico").toString(); |
57039 | 81 |
} else if (JPackageHelper.isOSX()) { |
57407 | 82 |
return Path.of("output", name + ".app", |
83 |
"Contents", "Resources", name + ".icns").toString(); |
|
57039 | 84 |
} else if (JPackageHelper.isLinux()) { |
57407 | 85 |
return Path.of("output", name, "bin", name + ".png").toString(); |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
86 |
} else { |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
87 |
throw new AssertionError("Cannot detect platform"); |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
88 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
89 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
90 |
|
57407 | 91 |
// Returns path to generate secondary launcher of given application |
92 |
public static String getAppSL(String sl) { |
|
93 |
return getAppSL("test", sl); |
|
94 |
} |
|
95 |
||
96 |
public static String getAppSL(String app, String sl) { |
|
57039 | 97 |
if (JPackageHelper.isWindows()) { |
57740 | 98 |
return Path.of("output", app, sl + ".exe").toString(); |
57039 | 99 |
} else if (JPackageHelper.isOSX()) { |
57407 | 100 |
return Path.of("output", app + ".app", |
101 |
"Contents", "MacOS", sl).toString(); |
|
57039 | 102 |
} else if (JPackageHelper.isLinux()) { |
57407 | 103 |
return Path.of("output", app, "bin", sl).toString(); |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
104 |
} else { |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
105 |
throw new AssertionError("Cannot detect platform"); |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
106 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
107 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
108 |
|
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
109 |
// Returns path to test application cfg file |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
110 |
public static String getAppCfg() { |
57407 | 111 |
return getAppCfg("test"); |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
112 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
113 |
|
57407 | 114 |
public static String getAppCfg(String name) { |
57039 | 115 |
if (JPackageHelper.isWindows()) { |
57407 | 116 |
return Path.of("output", name, "app", name + ".cfg").toString(); |
57039 | 117 |
} else if (JPackageHelper.isOSX()) { |
57407 | 118 |
return Path.of("output", name + ".app", |
119 |
"Contents", "Java", name + ".cfg").toString(); |
|
57039 | 120 |
} else if (JPackageHelper.isLinux()) { |
57407 | 121 |
return Path.of("output", name, "app", name + ".cfg").toString(); |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
122 |
} else { |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
123 |
throw new AssertionError("Cannot detect platform"); |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
124 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
125 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
126 |
|
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
127 |
// Returns path including executable to java in image runtime folder |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
128 |
public static String getRuntimeJava() { |
57407 | 129 |
return getRuntimeJava("test"); |
130 |
} |
|
131 |
||
132 |
public static String getRuntimeJava(String name) { |
|
57039 | 133 |
if (JPackageHelper.isWindows()) { |
57407 | 134 |
return Path.of("output", name, |
135 |
"runtime", "bin", "java.exe").toString(); |
|
57039 | 136 |
} else if (JPackageHelper.isOSX()) { |
57407 | 137 |
return Path.of("output", name + ".app", "Contents", |
138 |
"runtime", "Contents", "Home", "bin", "java").toString(); |
|
57039 | 139 |
} else if (JPackageHelper.isLinux()) { |
57407 | 140 |
return Path.of("output", name, |
141 |
"runtime", "bin", "java").toString(); |
|
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
142 |
} else { |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
143 |
throw new AssertionError("Cannot detect platform"); |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
144 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
145 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
146 |
|
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
147 |
// Returns output file name generate by test application |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
148 |
public static String getAppOutputFile() { |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
149 |
return "appOutput.txt"; |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
150 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
151 |
|
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
152 |
// Returns path to bin folder in image runtime |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
153 |
public static String getRuntimeBin() { |
57407 | 154 |
return getRuntimeBin("test"); |
155 |
} |
|
156 |
||
157 |
public static String getRuntimeBin(String name) { |
|
57039 | 158 |
if (JPackageHelper.isWindows()) { |
57407 | 159 |
return Path.of("output", name, "runtime", "bin").toString(); |
57039 | 160 |
} else if (JPackageHelper.isOSX()) { |
57407 | 161 |
return Path.of("output", name + ".app", |
162 |
"Contents", "runtime", |
|
163 |
"Contents", "Home", "bin").toString(); |
|
57039 | 164 |
} else if (JPackageHelper.isLinux()) { |
57407 | 165 |
return Path.of("output", name, "runtime", "bin").toString(); |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
166 |
} else { |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
167 |
throw new AssertionError("Cannot detect platform"); |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
168 |
} |
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
169 |
} |
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
170 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
171 |
public static String getWinProgramFiles() { |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
172 |
return WIN_PROGRAM_FILES; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
173 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
174 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
175 |
public static String getWinUserLocal() { |
57407 | 176 |
return Path.of(System.getProperty("user.home"), |
177 |
"AppData", "Local").toString(); |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
178 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
179 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
180 |
public static String getWinStartMenu() { |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
181 |
return WIN_START_MENU; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
182 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
183 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
184 |
public static String getWinPublicDesktop() { |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
185 |
return WIN_PUBLIC_DESKTOP; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
186 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
187 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
188 |
public static String getWinUserLocalStartMenu() { |
57407 | 189 |
return Path.of(System.getProperty("user.home"), "AppData", "Roaming", |
190 |
"Microsoft", "Windows", "Start Menu", "Programs").toString(); |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
191 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
192 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
193 |
public static String getWinInstalledApp(String testName) { |
57407 | 194 |
return Path.of(getWinProgramFiles(), testName, |
195 |
testName + ".exe").toString(); |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
196 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
197 |
|
57407 | 198 |
public static String getWinInstalledApp(String installDir, |
199 |
String testName) { |
|
57740 | 200 |
return Path.of(getWinProgramFiles(), installDir, |
57407 | 201 |
testName + ".exe").toString(); |
57283 | 202 |
} |
203 |
||
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
204 |
public static String getOSXInstalledApp(String testName) { |
57407 | 205 |
return File.separator + "Applications" |
206 |
+ File.separator + testName + ".app" |
|
207 |
+ File.separator + "Contents" |
|
208 |
+ File.separator + "MacOS" |
|
209 |
+ File.separator + testName; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
210 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
211 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
212 |
public static String getLinuxInstalledApp(String testName) { |
57407 | 213 |
return File.separator + "opt" |
214 |
+ File.separator + testName |
|
215 |
+ File.separator + testName; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
216 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
217 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
218 |
public static String getOSXInstalledApp(String subDir, String testName) { |
57407 | 219 |
return File.separator + "Applications" |
220 |
+ File.separator + subDir |
|
221 |
+ File.separator + testName + ".app" |
|
222 |
+ File.separator + "Contents" |
|
223 |
+ File.separator + "MacOS" |
|
224 |
+ File.separator + testName; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
225 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
226 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
227 |
public static String getLinuxInstalledApp(String subDir, String testName) { |
57407 | 228 |
return File.separator + "opt" |
229 |
+ File.separator + subDir |
|
230 |
+ File.separator + testName |
|
231 |
+ File.separator + testName; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
232 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
233 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
234 |
public static String getWinInstallFolder(String testName) { |
57407 | 235 |
return getWinProgramFiles() |
236 |
+ File.separator + testName; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
237 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
238 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
239 |
public static String getLinuxInstallFolder(String testName) { |
57407 | 240 |
return File.separator + "opt" |
241 |
+ File.separator + testName; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
242 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
243 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
244 |
public static String getLinuxInstallFolder(String subDir, String testName) { |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
245 |
if (testName == null) { |
57407 | 246 |
return File.separator + "opt" |
247 |
+ File.separator + subDir; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
248 |
} else { |
57407 | 249 |
return File.separator + "opt" |
250 |
+ File.separator + subDir |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
251 |
+ File.separator + testName; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
252 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
253 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
254 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
255 |
public static String getWinUserLocalInstalledApp(String testName) { |
57407 | 256 |
return getWinUserLocal() |
257 |
+ File.separator + testName |
|
258 |
+ File.separator + testName + ".exe"; |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
259 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
260 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
261 |
public static String getWinUserLocalInstallFolder(String testName) { |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
262 |
return getWinUserLocal() + File.separator + testName; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
263 |
} |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
264 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
265 |
// Returs path to test license file |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
266 |
public static String getLicenseFilePath() { |
57407 | 267 |
String path = JPackagePath.getTestSrcRoot() |
268 |
+ File.separator + "resources" |
|
57079
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
269 |
+ File.separator + "license.txt"; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
270 |
|
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
271 |
return path; |
c53a2eca0f57
8215036: Create initial set of tests for jpackage create-installer mode
herrick
parents:
57039
diff
changeset
|
272 |
} |
57181
d10b861e8d62
8214564: --win-upgrade-uuid does not work as expected
herrick
parents:
57106
diff
changeset
|
273 |
|
d10b861e8d62
8214564: --win-upgrade-uuid does not work as expected
herrick
parents:
57106
diff
changeset
|
274 |
// Returns path to app folder of installed application |
d10b861e8d62
8214564: --win-upgrade-uuid does not work as expected
herrick
parents:
57106
diff
changeset
|
275 |
public static String getWinInstalledAppFolder(String testName) { |
57407 | 276 |
return getWinProgramFiles() |
277 |
+ File.separator + testName |
|
278 |
+ File.separator + "app"; |
|
57181
d10b861e8d62
8214564: --win-upgrade-uuid does not work as expected
herrick
parents:
57106
diff
changeset
|
279 |
} |
57031
ea4755429ed8
8214021: Create additional automated tests for jpackager
herrick
parents:
diff
changeset
|
280 |
} |