8226599: use code coverage results to remove dead code
Reviewed-by: asemenyuk, almatvee
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -86,7 +86,7 @@
@Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
@@ -103,10 +103,7 @@
}
private boolean doValidate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
- if (Platform.getPlatform() != Platform.LINUX) {
- throw new UnsupportedPlatformException();
- }
+ throws ConfigException {
imageBundleValidation(params);
@@ -119,10 +116,6 @@
return new File(outDir, APP_NAME.fetchFrom(params));
}
- static String getLauncherCfgName(Map<String, ? super Object> params) {
- return "app/" + APP_NAME.fetchFrom(params) +".cfg";
- }
-
File doBundle(Map<String, ? super Object> params, File outputDirectory,
boolean dependentTask) throws PackagerException {
if (StandardBundlerParam.isRuntimeInstaller(params)) {
@@ -160,11 +153,6 @@
}
@Override
- public String getDescription() {
- return I18N.getString("app.bundler.description");
- }
-
- @Override
public String getID() {
return "linux.app";
}
@@ -175,25 +163,6 @@
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- return getAppBundleParameters();
- }
-
- static Collection<BundlerParamInfo<?>> getAppBundleParameters() {
- return Arrays.asList(
- APP_NAME,
- APP_RESOURCES,
- ARGUMENTS,
- CLASSPATH,
- JAVA_OPTIONS,
- MAIN_CLASS,
- MAIN_JAR,
- VERSION,
- VERBOSE
- );
- }
-
- @Override
public File execute(Map<String, ? super Object> params,
File outputParentDir) throws PackagerException {
return doBundle(params, outputParentDir, false);
@@ -201,6 +170,6 @@
@Override
public boolean supported(boolean runtimeInstaller) {
- return (Platform.getPlatform() == Platform.LINUX);
+ return true;
}
}
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java Thu Jun 27 17:44:18 2019 -0400
@@ -113,36 +113,11 @@
this.params = new HashMap<>();
}
- private Path destFile(String dir, String filename) {
- return runtimeDir.resolve(dir).resolve(filename);
- }
-
private void writeEntry(InputStream in, Path dstFile) throws IOException {
Files.createDirectories(dstFile.getParent());
Files.copy(in, dstFile);
}
- private void writeSymEntry(Path dstFile, Path target) throws IOException {
- Files.createDirectories(dstFile.getParent());
- Files.createLink(dstFile, target);
- }
-
- /**
- * chmod ugo+x file
- */
- private void setExecutable(Path file) {
- try {
- Set<PosixFilePermission> perms =
- Files.getPosixFilePermissions(file);
- perms.add(PosixFilePermission.OWNER_EXECUTE);
- perms.add(PosixFilePermission.GROUP_EXECUTE);
- perms.add(PosixFilePermission.OTHERS_EXECUTE);
- Files.setPosixFilePermissions(file, perms);
- } catch (IOException ioe) {
- throw new UncheckedIOException(ioe);
- }
- }
-
// it is static for the sake of sharing with "installer" bundlers
// that may skip calls to validate/bundle in this class!
public static File getRootDir(File outDir,
@@ -155,7 +130,7 @@
return "bin" + File.separator + APP_NAME.fetchFrom(params);
}
- public static String getLauncherName(Map<String, ? super Object> params) {
+ private static String getLauncherName(Map<String, ? super Object> params) {
return APP_NAME.fetchFrom(params);
}
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -219,7 +219,7 @@
@Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
@@ -756,12 +756,6 @@
return new File(rootDir, APP_NAME.fetchFrom(params) + ".png");
}
- private File getConfig_InitScriptFile(Map<String, ? super Object> params) {
- return new File(LinuxAppBundler.getRootDir(
- APP_IMAGE_ROOT.fetchFrom(params), params),
- BUNDLE_NAME.fetchFrom(params) + ".init");
- }
-
private File getConfig_ControlFile(Map<String, ? super Object> params) {
return new File(CONFIG_DIR.fetchFrom(params), "control");
}
@@ -815,11 +809,6 @@
}
@Override
- public String getDescription() {
- return I18N.getString("deb.bundler.description");
- }
-
- @Override
public String getID() {
return "deb";
}
@@ -830,27 +819,6 @@
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
- results.addAll(LinuxAppBundler.getAppBundleParameters());
- results.addAll(getDebBundleParameters());
- return results;
- }
-
- public static Collection<BundlerParamInfo<?>> getDebBundleParameters() {
- return Arrays.asList(
- BUNDLE_NAME,
- COPYRIGHT,
- MENU_GROUP,
- DESCRIPTION,
- EMAIL,
- ICON_PNG,
- LICENSE_FILE,
- VENDOR
- );
- }
-
- @Override
public File execute(Map<String, ? super Object> params,
File outputParentDir) throws PackagerException {
return bundle(params, outputParentDir);
@@ -858,6 +826,10 @@
@Override
public boolean supported(boolean runtimeInstaller) {
+ return isSupported();
+ }
+
+ public static boolean isSupported() {
if (Platform.getPlatform() == Platform.LINUX) {
if (testTool(TOOL_DPKG, "1")) {
return true;
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -174,7 +174,7 @@
@Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
@@ -658,11 +658,6 @@
}
@Override
- public String getDescription() {
- return I18N.getString("rpm.bundler.description");
- }
-
- @Override
public String getID() {
return "rpm";
}
@@ -673,26 +668,6 @@
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
- results.addAll(LinuxAppBundler.getAppBundleParameters());
- results.addAll(getRpmBundleParameters());
- return results;
- }
-
- public static Collection<BundlerParamInfo<?>> getRpmBundleParameters() {
- return Arrays.asList(
- BUNDLE_NAME,
- MENU_GROUP,
- DESCRIPTION,
- LinuxAppBundler.ICON_PNG,
- LICENSE_FILE,
- LICENSE_TYPE,
- VENDOR
- );
- }
-
- @Override
public File execute(Map<String, ? super Object> params,
File outputParentDir) throws PackagerException {
return bundle(params, outputParentDir);
@@ -700,6 +675,10 @@
@Override
public boolean supported(boolean runtimeInstaller) {
+ return isSupported();
+ }
+
+ public static boolean isSupported() {
if (Platform.getPlatform() == Platform.LINUX) {
if (testTool(TOOL_RPMBUILD, TOOL_RPMBUILD_MIN_VERSION)) {
return true;
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources.properties Thu Jun 27 17:44:18 2019 -0400
@@ -24,11 +24,8 @@
#
#
app.bundler.name=Linux Application Image
-app.bundler.description=A Directory based image of a linux Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
deb.bundler.name=DEB Installer
-deb.bundler.description=Linux Debian Bundle
rpm.bundler.name=RPM Bundle
-rpm.bundler.description=Redhat Package Manager (RPM) bundler.
param.license-type.default=Unknown
param.menu-group.default=Unknown
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources_ja.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources_ja.properties Thu Jun 27 17:44:18 2019 -0400
@@ -24,11 +24,8 @@
#
#
app.bundler.name=Linux Application Image
-app.bundler.description=A Directory based image of a linux Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
deb.bundler.name=DEB Installer
-deb.bundler.description=Linux Debian Bundle
rpm.bundler.name=RPM Bundle
-rpm.bundler.description=Redhat Package Manager (RPM) bundler.
param.license-type.default=Unknown
param.menu-group.default=Unknown
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources_zh_CN.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources_zh_CN.properties Thu Jun 27 17:44:18 2019 -0400
@@ -24,11 +24,8 @@
#
#
app.bundler.name=Linux Application Image
-app.bundler.description=A Directory based image of a linux Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
deb.bundler.name=DEB Installer
-deb.bundler.description=Linux Debian Bundle
rpm.bundler.name=RPM Bundle
-rpm.bundler.description=Redhat Package Manager (RPM) bundler.
param.license-type.default=Unknown
param.menu-group.default=Unknown
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/EnumeratedBundlerParam.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.jpackage.internal;
+
+import java.util.*;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+
+/**
+ * EnumeratedBundlerParams<T>
+ *
+ * Contains key-value pairs (elements) where keys are "displayable"
+ * keys which the IDE can display/choose and values are "identifier" values
+ * which can be stored in parameters' map.
+ *
+ * For instance the Mac has a predefined set of categories which can be applied
+ * to LSApplicationCategoryType which is required for the mac app store.
+ *
+ * The following example illustrates a simple usage of
+ * the MAC_CATEGORY parameter:
+ *
+ * <pre>{@code
+ * Set<String> keys = MAC_CATEGORY.getDisplayableKeys();
+ *
+ * String key = getLastValue(keys); // get last value for example
+ *
+ * String value = MAC_CATEGORY.getValueForDisplayableKey(key);
+ * params.put(MAC_CATEGORY.getID(), value);
+ * }</pre>
+ *
+ */
+class EnumeratedBundlerParam<T> extends BundlerParamInfo<T> {
+ // Not sure if this is the correct order, my idea is that from IDE
+ // perspective the string to display to the user is the key and then the
+ // value is some type of object (although probably a String in most cases)
+ private final Map<String, T> elements;
+ private final boolean strict;
+
+ EnumeratedBundlerParam(String id, Class<T> valueType,
+ Function<Map<String, ? super Object>, T> defaultValueFunction,
+ BiFunction<String, Map<String, ? super Object>, T> stringConverter,
+ Map<String, T> elements, boolean strict) {
+ this.id = id;
+ this.valueType = valueType;
+ this.defaultValueFunction = defaultValueFunction;
+ this.stringConverter = stringConverter;
+ this.elements = elements;
+ this.strict = strict;
+ }
+
+ boolean isInPossibleValues(T value) {
+ return elements.values().contains(value);
+ }
+
+ // Having the displayable values as the keys seems a bit wacky
+ Set<String> getDisplayableKeys() {
+ return Collections.unmodifiableSet(elements.keySet());
+ }
+
+ // mapping from a "displayable" key to an "identifier" value.
+ T getValueForDisplayableKey(String displayableKey) {
+ return elements.get(displayableKey);
+ }
+
+ boolean isStrict() {
+ return strict;
+ }
+
+ boolean isLoose() {
+ return !isStrict();
+ }
+
+}
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -240,7 +240,7 @@
@Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
return doValidate(params);
} catch (RuntimeException re) {
@@ -253,10 +253,7 @@
}
private boolean doValidate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
- if (Platform.getPlatform() != Platform.MAC) {
- throw new UnsupportedPlatformException();
- }
+ throws ConfigException {
imageBundleValidation(params);
@@ -327,11 +324,6 @@
}
@Override
- public String getDescription() {
- return I18N.getString("app.bundler.description");
- }
-
- @Override
public String getID() {
return "mac.app";
}
@@ -342,34 +334,6 @@
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- return getAppBundleParameters();
- }
-
- public static Collection<BundlerParamInfo<?>> getAppBundleParameters() {
- return Arrays.asList(
- APP_NAME,
- APP_RESOURCES,
- ARGUMENTS,
- BUNDLE_ID_SIGNING_PREFIX,
- CLASSPATH,
- DEVELOPER_ID_APP_SIGNING_KEY,
- ICON_ICNS,
- JAVA_OPTIONS,
- MAC_CATEGORY,
- MAC_CF_BUNDLE_IDENTIFIER,
- MAC_CF_BUNDLE_NAME,
- MAC_CF_BUNDLE_VERSION,
- MAIN_CLASS,
- MAIN_JAR,
- SIGNING_KEYCHAIN,
- VERSION,
- VERBOSE
- );
- }
-
-
- @Override
public File execute(Map<String, ? super Object> params,
File outputParentDir) throws PackagerException {
return doBundle(params, outputParentDir, false);
@@ -377,7 +341,7 @@
@Override
public boolean supported(boolean runtimeInstaller) {
- return Platform.getPlatform() == Platform.MAC;
+ return true;
}
}
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java Thu Jun 27 17:44:18 2019 -0400
@@ -211,28 +211,6 @@
Files.copy(in, dstFile);
}
- // chmod ugo+x file
- private void setExecutable(Path file) {
- try {
- Set<PosixFilePermission> perms =
- Files.getPosixFilePermissions(file);
- perms.add(PosixFilePermission.OWNER_EXECUTE);
- perms.add(PosixFilePermission.GROUP_EXECUTE);
- perms.add(PosixFilePermission.OTHERS_EXECUTE);
- Files.setPosixFilePermissions(file, perms);
- } catch (IOException ioe) {
- throw new UncheckedIOException(ioe);
- }
- }
-
- private static void createUtf8File(File file, String content)
- throws IOException {
- try (OutputStream fout = new FileOutputStream(file);
- Writer output = new OutputStreamWriter(fout, "UTF-8")) {
- output.write(content);
- }
- }
-
public static boolean validCFBundleVersion(String v) {
// CFBundleVersion (String - iOS, OS X) specifies the build version
// number of the bundle, which identifies an iteration (released or
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -254,47 +254,14 @@
}
@Override
- public String getDescription() {
- return I18N.getString("store.bundler.description");
- }
-
- @Override
public String getID() {
return "mac.appStore";
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
- results.addAll(getAppBundleParameters());
- results.addAll(getMacAppStoreBundleParameters());
- return results;
- }
-
- public Collection<BundlerParamInfo<?>> getMacAppStoreBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
-
- results.addAll(getAppBundleParameters());
- results.remove(DEVELOPER_ID_APP_SIGNING_KEY);
- results.addAll(Arrays.asList(
- INSTALLER_SUFFIX,
- MAC_APP_STORE_APP_SIGNING_KEY,
- MAC_APP_STORE_ENTITLEMENTS,
- MAC_APP_STORE_PKG_SIGNING_KEY,
- SIGNING_KEYCHAIN
- ));
-
- return results;
- }
-
- @Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
- if (Platform.getPlatform() != Platform.MAC) {
- throw new UnsupportedPlatformException();
- }
-
if (params == null) {
throw new ConfigException(
I18N.getString("error.parameters-null"),
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -104,8 +104,7 @@
(s, p) -> s);
protected void validateAppImageAndBundeler(
- Map<String, ? super Object> params)
- throws ConfigException, UnsupportedPlatformException {
+ Map<String, ? super Object> params) throws ConfigException {
if (PREDEFINED_APP_IMAGE.fetchFrom(params) != null) {
File applicationImage = PREDEFINED_APP_IMAGE.fetchFrom(params);
if (!applicationImage.exists()) {
@@ -153,21 +152,6 @@
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
-
- results.addAll(MacAppBundler.getAppBundleParameters());
- results.addAll(Arrays.asList(
- APP_BUNDLER,
- CONFIG_ROOT,
- APP_IMAGE_TEMP_ROOT,
- PREDEFINED_APP_IMAGE
- ));
-
- return results;
- }
-
- @Override
public String getBundleType() {
return "INSTALLER";
}
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -346,6 +346,7 @@
pb = new ProcessBuilder(
hdiutil,
"detach",
+ "-force",
hdiUtilVerbosityFlag,
mountedRoot.getAbsolutePath());
IOUtils.exec(pb);
@@ -411,39 +412,13 @@
}
@Override
- public String getDescription() {
- return I18N.getString("dmg.bundler.description");
- }
-
- @Override
public String getID() {
return "dmg";
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
- results.addAll(MacAppBundler.getAppBundleParameters());
- results.addAll(getDMGBundleParameters());
- return results;
- }
-
- public Collection<BundlerParamInfo<?>> getDMGBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
-
- results.addAll(MacAppBundler.getAppBundleParameters());
- results.addAll(Arrays.asList(
- INSTALLER_SUFFIX,
- LICENSE_FILE
- ));
-
- return results;
- }
-
-
- @Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
@@ -471,6 +446,22 @@
@Override
public boolean supported(boolean runtimeInstaller) {
- return Platform.getPlatform() == Platform.MAC;
+ return isSupported();
+ }
+
+ public final static String[] required =
+ {"/usr/bin/hdiutil", "/usr/bin/osascript"};
+ public static boolean isSupported() {
+ try {
+ for (String s : required) {
+ File f = new File(s);
+ if (!f.exists() || !f.canExecute()) {
+ return false;
+ }
+ }
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
}
}
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -488,39 +488,13 @@
}
@Override
- public String getDescription() {
- return I18N.getString("pkg.bundler.description");
- }
-
- @Override
public String getID() {
return "pkg";
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
- results.addAll(MacAppBundler.getAppBundleParameters());
- results.addAll(getPKGBundleParameters());
- return results;
- }
-
- public Collection<BundlerParamInfo<?>> getPKGBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
-
- results.addAll(MacAppBundler.getAppBundleParameters());
- results.addAll(Arrays.asList(
- DEVELOPER_ID_INSTALLER_SIGNING_KEY,
- INSTALLER_SUFFIX,
- LICENSE_FILE,
- SIGNING_KEYCHAIN));
-
- return results;
- }
-
- @Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
@@ -564,7 +538,7 @@
@Override
public boolean supported(boolean runtimeInstaller) {
- return Platform.getPlatform() == Platform.MAC;
+ return true;
}
}
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties Thu Jun 27 17:44:18 2019 -0400
@@ -25,13 +25,9 @@
#
app.bundler.name=Mac Application Image
-app.bundler.description=A Directory based image of a mac Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
store.bundler.name=Mac App Store Ready Bundler
-store.bundler.description=Creates a binary bundle ready for deployment into the Mac App Store.
dmg.bundler.name=DMG Installer
-dmg.bundler.description=Mac DMG Installer Bundle
pkg.bundler.name=PKG Installer
-pkg.bundler.description=Mac PKG Installer Bundle
error.invalid-cfbundle-version=Invalid CFBundleVersion: [{0}].
error.invalid-cfbundle-version.advice=Set a compatible 'appVersion' or set a 'mac.CFBundleVersion'. Valid versions are one to three integers separated by dots.
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources_ja.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources_ja.properties Thu Jun 27 17:44:18 2019 -0400
@@ -25,13 +25,9 @@
#
app.bundler.name=Mac Application Image
-app.bundler.description=A Directory based image of a mac Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
store.bundler.name=Mac App Store Ready Bundler
-store.bundler.description=Creates a binary bundle ready for deployment into the Mac App Store.
dmg.bundler.name=DMG Installer
-dmg.bundler.description=Mac DMG Installer Bundle
pkg.bundler.name=PKG Installer
-pkg.bundler.description=Mac PKG Installer Bundle
error.invalid-cfbundle-version=Invalid CFBundleVersion: [{0}].
error.invalid-cfbundle-version.advice=Set a compatible 'appVersion' or set a 'mac.CFBundleVersion'. Valid versions are one to three integers separated by dots.
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources_zh_CN.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources_zh_CN.properties Thu Jun 27 17:44:18 2019 -0400
@@ -25,13 +25,9 @@
#
app.bundler.name=Mac Application Image
-app.bundler.description=A Directory based image of a mac Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
store.bundler.name=Mac App Store Ready Bundler
-store.bundler.description=Creates a binary bundle ready for deployment into the Mac App Store.
dmg.bundler.name=DMG Installer
-dmg.bundler.description=Mac DMG Installer Bundle
pkg.bundler.name=PKG Installer
-pkg.bundler.description=Mac PKG Installer Bundle
error.invalid-cfbundle-version=Invalid CFBundleVersion: [{0}].
error.invalid-cfbundle-version.advice=Set a compatible 'appVersion' or set a 'mac.CFBundleVersion'. Valid versions are one to three integers separated by dots.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java Thu Jun 27 17:44:18 2019 -0400
@@ -54,11 +54,9 @@
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.MainResources");
- private final Map<String, Object> properties;
private final Path root;
- public AbstractAppImageBuilder(Map<String, Object> properties, Path root) {
- this.properties = properties;
+ public AbstractAppImageBuilder(Map<String, Object> unused, Path root) {
this.root = root;
}
@@ -71,10 +69,6 @@
public abstract Path getAppDir();
public abstract Path getAppModsDir();
- public Map<String, Object> getProperties() {
- return this.properties;
- }
-
public Path getRoot() {
return this.root;
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java Thu Jun 27 17:44:18 2019 -0400
@@ -155,13 +155,6 @@
}
}
- private void putUnlessNullOrEmpty(Map<String, ? super Object> params,
- String param, Map<?, ?> value) {
- if (value != null && !value.isEmpty()) {
- params.put(param, value);
- }
- }
-
static Map<String, ? super Object> merge(
Map<String, ? super Object> original,
Map<String, ? super Object> additional) {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Thu Jun 27 17:44:18 2019 -0400
@@ -64,7 +64,6 @@
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.MainResources");
- private static final String IMAGE_PACKAGE_TYPE = "app-image";
private static final String FA_EXTENSIONS = "extension";
private static final String FA_CONTENT_TYPE = "mime-type";
private static final String FA_DESCRIPTION = "description";
@@ -377,8 +376,7 @@
}
String getIdWithPrefix() {
- String prefix = isMode() ? "" : "--";
- return prefix + this.id;
+ return "--" + this.id;
}
String getShortIdWithPrefix() {
@@ -393,14 +391,6 @@
}
}
- boolean isMode() {
- return category == OptionCategories.MODE;
- }
-
- OptionCategories getCategory() {
- return category;
- }
-
private void defaultAction() {
context().deployParams.addBundleArgument(id, popArg());
}
@@ -424,17 +414,12 @@
context().pos++;
}
- private static void prevArg() {
- context().pos--;
- }
-
private static boolean hasNextArg() {
return context().pos < context().argList.size();
}
}
enum OptionCategories {
- MODE,
MODULAR,
PROPERTY,
PLATFORM_MAC,
@@ -541,7 +526,7 @@
private void validateArguments() throws PackagerException {
String packageType = deployParams.getTargetFormat();
String ptype = (packageType != null) ? packageType : "default";
- boolean imageOnly = IMAGE_PACKAGE_TYPE.equals(packageType);
+ boolean imageOnly = (packageType == null);
boolean hasAppImage = allOptions.contains(
CLIOptions.PREDEFINED_APP_IMAGE);
boolean hasRuntime = allOptions.contains(
@@ -634,10 +619,6 @@
Log.verbose(MessageFormat.format(
I18N.getString("message.bundle-created"),
bundler.getName()));
- } catch (UnsupportedPlatformException upe) {
- Log.debug(upe);
- throw new PackagerException(upe,
- "MSG_BundlerPlatformException", bundler.getName());
} catch (ConfigException e) {
Log.debug(e);
if (e.getAdvice() != null) {
@@ -694,10 +675,6 @@
deployParams.setClasspath();
}
- static boolean isCLIOption(String arg) {
- return toCLIOption(arg) != null;
- }
-
static CLIOptions toCLIOption(String arg) {
CLIOptions option;
if ((option = argIds.get(arg)) == null) {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BasicBundlers.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BasicBundlers.java Thu Jun 27 17:44:18 2019 -0400
@@ -75,11 +75,6 @@
}
}
- @Override
- public void loadDefaultBundlers() {
- // no-op. We now load all bundlers from module system.
- }
-
// Loads bundlers from the META-INF/services direct
@Override
public void loadBundlersFromServices(ClassLoader cl) {
@@ -88,9 +83,4 @@
bundlers.add(aLoader);
}
}
-
- @Override
- public void loadBundler(Bundler bundler) {
- bundlers.add(bundler);
- }
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java Thu Jun 27 17:44:18 2019 -0400
@@ -108,30 +108,6 @@
this.params.putAll(params);
}
- public <T> T fetchParam(BundlerParamInfo<T> paramInfo) {
- return paramInfo.fetchFrom(params);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T fetchParamWithDefault(
- Class<T> klass, T defaultValue, String... keys) {
- for (String key : keys) {
- Object o = params.get(key);
- if (klass.isInstance(o)) {
- return (T) o;
- } else if (params.containsKey(key) && o == null) {
- return null;
- } else if (o != null) {
- Log.debug("Bundle param " + key + " is not type " + klass);
- }
- }
- return defaultValue;
- }
-
- public <T> T fetchParam(Class<T> klass, String... keys) {
- return fetchParamWithDefault(klass, null, keys);
- }
-
// NOTE: we do not care about application parameters here
// as they will be embeded into jar file manifest and
// java launcher will take care of them!
@@ -140,80 +116,8 @@
return new HashMap<>(params);
}
- public void setJvmargs(List<String> jvmargs) {
- putUnlessNullOrEmpty(JAVA_OPTIONS.getID(), jvmargs);
- }
-
- public void setAddModules(String value) {
- putUnlessNull(StandardBundlerParam.ADD_MODULES.getID(), value);
- }
-
- public void setLimitModules(String value) {
- putUnlessNull(StandardBundlerParam.LIMIT_MODULES.getID(), value);
- }
-
- public void setModulePath(String value) {
- putUnlessNull(StandardBundlerParam.MODULE_PATH.getID(), value);
- }
-
- public void setMainModule(String value) {
- putUnlessNull(StandardBundlerParam.MODULE.getID(), value);
- }
-
- public String getApplicationID() {
- return fetchParam(IDENTIFIER);
- }
-
- public String getApplicationClass() {
- return fetchParam(MAIN_CLASS);
- }
-
- public void setApplicationClass(String applicationClass) {
- putUnlessNull(PARAM_APPLICATION_CLASS, applicationClass);
- }
-
- public String getAppVersion() {
- return fetchParam(VERSION);
- }
-
- public void setAppVersion(String version) {
- putUnlessNull(PARAM_VERSION, version);
- }
-
- public String getDescription() {
- return fetchParam(DESCRIPTION);
- }
-
- public void setDescription(String s) {
- putUnlessNull(PARAM_DESCRIPTION, s);
- }
-
- public void setInstalldirChooser(Boolean b) {
- putUnlessNull(PARAM_INSTALLDIR_CHOOSER, b);
- }
-
public String getName() {
- return fetchParam(APP_NAME);
- }
-
- public void setName(String name) {
- putUnlessNull(PARAM_NAME, name);
- }
-
- public boolean getVerbose() {
- return fetchParam(VERBOSE);
- }
-
- public List<String> getJvmargs() {
- return JAVA_OPTIONS.fetchFrom(params);
- }
-
- public jdk.jpackage.internal.RelativeFileSet getAppResource() {
- return fetchParam(APP_RESOURCES);
- }
-
- public void setAppResource(jdk.jpackage.internal.RelativeFileSet fs) {
- putUnlessNull(PARAM_APP_RESOURCES, fs);
+ return APP_NAME.fetchFrom(params);
}
public void setAppResourcesList(
@@ -221,114 +125,9 @@
putUnlessNull(APP_RESOURCES_LIST.getID(), rfs);
}
- public String getMainClassName() {
- String applicationClass = getApplicationClass();
-
- if (applicationClass == null) {
- return null;
- }
-
- int idx = applicationClass.lastIndexOf(".");
- if (idx >= 0) {
- return applicationClass.substring(idx+1);
- }
- return applicationClass;
- }
-
- public String getCopyright() {
- return fetchParam(COPYRIGHT);
- }
-
- public void setCopyright(String c) {
- putUnlessNull(PARAM_COPYRIGHT, c);
- }
-
- private String mainJar = null;
-
- // assuming that application was packaged according to the rules
- // we must have application jar, i.e. jar where we embed launcher
- // and have main application class listed as main class!
- // If there are more than one, or none - it will be treated as an error
-
- public String getMainApplicationJar() {
- jdk.jpackage.internal.RelativeFileSet appResources = getAppResource();
- if (mainJar != null) {
- if (getApplicationClass() == null) try {
- if (appResources != null) {
- File srcdir = appResources.getBaseDirectory();
- JarFile jf = new JarFile(new File(srcdir, mainJar));
- Manifest m = jf.getManifest();
- Attributes attrs = (m != null) ?
- m.getMainAttributes() : null;
- if (attrs != null) {
- setApplicationClass(
- attrs.getValue(Attributes.Name.MAIN_CLASS));
- }
- }
- } catch (IOException ignore) {
- }
- return mainJar;
- }
-
- String applicationClass = getApplicationClass();
-
- if (appResources == null || applicationClass == null) {
- return null;
- }
- File srcdir = appResources.getBaseDirectory();
- for (String fname : appResources.getIncludedFiles()) {
- JarFile jf;
- try {
- jf = new JarFile(new File(srcdir, fname));
- Manifest m = jf.getManifest();
- Attributes attrs = (m != null) ? m.getMainAttributes() : null;
- if (attrs != null) {
- boolean javaMain = applicationClass.equals(
- attrs.getValue(Attributes.Name.MAIN_CLASS));
-
- if (javaMain) {
- mainJar = fname;
- return mainJar;
- }
- }
- } catch (IOException ignore) {
- }
- }
- return null;
- }
-
- public String getVendor() {
- return fetchParam(VENDOR);
- }
-
- public void setVendor(String vendor) {
- putUnlessNull(PARAM_VENDOR, vendor);
- }
-
- public String getEmail() {
- return fetchParam(String.class, PARAM_EMAIL);
- }
-
- public void setEmail(String email) {
- putUnlessNull(PARAM_EMAIL, email);
- }
-
- public void putUnlessNull(String param, Object value) {
+ private void putUnlessNull(String param, Object value) {
if (value != null) {
params.put(param, value);
}
}
-
- public void putUnlessNullOrEmpty(String param, Collection<?> value) {
- if (value != null && !value.isEmpty()) {
- params.put(param, value);
- }
- }
-
- public void putUnlessNullOrEmpty(String param, Map<?,?> value) {
- if (value != null && !value.isEmpty()) {
- params.put(param, value);
- }
- }
-
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -41,11 +41,6 @@
String getName();
/**
- * @return A more verbose description of the bundler.
- */
- String getDescription();
-
- /**
* @return Command line identifier of the bundler. Should be unique.
*/
String getID();
@@ -56,26 +51,18 @@
String getBundleType();
/**
- * The parameters that this bundler uses to generate it's bundle.
- * @return immutable collection
- */
- Collection<BundlerParamInfo<?>> getBundleParameters();
-
- /**
* Determines if this bundler will execute with the given parameters.
*
* @param params The parameters to be validate. Validation may modify
* the map, so if you are going to be using the same map
* across multiple bundlers you should pass in a deep copy.
* @return true if valid
- * @throws UnsupportedPlatformException If the bundler cannot run on this
- * platform (i.e. creating mac apps on windows)
* @throws ConfigException If the configuration params are incorrect. The
* exception may contain advice on how to modify the params map
* to make it valid.
*/
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException;
+ throws ConfigException;
/**
* Creates a bundle from existing content.
@@ -87,7 +74,7 @@
* It may or may not return a value, and it may or may not throw an
* exception. But any output should not be considered valid or sane.
*
- * @param params The parameters as specified by getBundleParameters.
+ * @param params The Bundle parameters,
* Keyed by the id from the ParamInfo. Execution may
* modify the map, so if you are going to be using the
* same map across multiple bundlers you should pass
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java Thu Jun 27 17:44:18 2019 -0400
@@ -70,10 +70,6 @@
return valueType;
}
- void setValueType(Class<T> valueType) {
- this.valueType = valueType;
- }
-
boolean getIsDefaultValue() {
return isDefaultValue;
}
@@ -82,21 +78,11 @@
return defaultValueFunction;
}
- void setDefaultValueFunction(
- Function<Map<String, ? super Object>, T> defaultValueFunction) {
- this.defaultValueFunction = defaultValueFunction;
- }
-
BiFunction<String, Map<String, ? super Object>,T>
getStringConverter() {
return stringConverter;
}
- void setStringConverter(BiFunction<String,
- Map<String, ? super Object>, T> stringConverter) {
- this.stringConverter = stringConverter;
- }
-
@SuppressWarnings("unchecked")
final T fetchFrom(Map<String, ? super Object> params) {
return fetchFrom(params, true);
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundlers.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundlers.java Thu Jun 27 17:44:18 2019 -0400
@@ -101,30 +101,6 @@
Collection<Bundler> getBundlers(String type);
/**
- * Loads the bundlers common to the JDK. A typical implementation
- * would load:
- * <UL>
- * <LI>Windows file image</LI>
- * <LI>Mac .app</LI>
- * <LI>Linux file image</LI>
-
- * <LI>Windows MSI</LI>
- * <LI>Windows EXE</LI>
- * <LI>Mac DMG</LI>
- * <LI>Mac PKG</LI>
- * <LI>Linux DEB</LI>
- * <LI>Linux RPM</LI>
- *
- * </UL>
- *
- * This method is called from the
- * {@link #createBundlersInstance(ClassLoader)}
- * and {@link #createBundlersInstance()} methods.
- * NOTE: Because of the module system this method is now not used.
- */
- void loadDefaultBundlers();
-
- /**
* Loads bundlers from the META-INF/services directly.
*
* This method is called from the
@@ -133,11 +109,4 @@
*/
void loadBundlersFromServices(ClassLoader cl);
- /**
- * Loads a specific bundler into the set of bundlers.
- * Useful for a manually configured bundler.
- *
- * @param bundler the specific bundler to add
- */
- void loadBundler(Bundler bundler);
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Thu Jun 27 17:44:18 2019 -0400
@@ -53,72 +53,12 @@
final List<RelativeFileSet> resources = new ArrayList<>();
String targetFormat = null; // means app-image
- String licenseType;
- String copyright;
- String version;
- String applicationClass;
-
- // Java modules support
- String addModules = null;
- String limitModules = null;
- String module = null;
File outdir = null;
-
- // list of jvm args
- // (in theory string can contain spaces and need to be escaped
- List<String> jvmargs = new LinkedList<>();
-
// raw arguments to the bundler
Map<String, ? super Object> bundlerArguments = new LinkedHashMap<>();
- void setLicenseType(String licenseType) {
- this.licenseType = licenseType;
- }
-
- void setCopyright(String copyright) {
- this.copyright = copyright;
- }
-
- void setVersion(String version) {
- this.version = version;
- }
-
- void addJvmArg(String v) {
- jvmargs.add(v);
- }
-
- void addAddModule(String value) {
- if (addModules == null) {
- addModules = value;
- }
- else {
- addModules += "," + value;
- }
- }
-
- void addLimitModule(String value) {
- if (limitModules == null) {
- limitModules = value;
- }
- else {
- limitModules += "," + value;
- }
- }
-
- void setModule(String value) {
- this.module = value;
- }
-
- void setApplicationClass(String applicationClass) {
- this.applicationClass = applicationClass;
- }
-
- File getOutput() {
- return outdir;
- }
-
public void setOutput(File output) {
outdir = output;
}
@@ -329,18 +269,6 @@
}
}
- boolean validateForBundle() {
- boolean result = false;
-
- // Success
- if (((applicationClass != null && !applicationClass.isEmpty()) ||
- (module != null && !module.isEmpty()))) {
- result = true;
- }
-
- return result;
- }
-
void setTargetFormat(String t) {
targetFormat = t;
}
@@ -392,24 +320,6 @@
// construct app resources relative to output folder!
bundleParams.setAppResourcesList(resources);
- bundleParams.setApplicationClass(applicationClass);
- bundleParams.setAppVersion(version);
- bundleParams.setCopyright(copyright);
-
- bundleParams.setJvmargs(jvmargs);
-
- if (addModules != null && !addModules.isEmpty()) {
- bundleParams.setAddModules(addModules);
- }
-
- if (limitModules != null && !limitModules.isEmpty()) {
- bundleParams.setLimitModules(limitModules);
- }
-
- if (module != null && !module.isEmpty()) {
- bundleParams.setMainModule(module);
- }
-
Map<String, String> unescapedHtmlParams = new TreeMap<>();
Map<String, String> escapedHtmlParams = new TreeMap<>();
@@ -427,10 +337,6 @@
return bundleParams;
}
- Map<String, ? super Object> getBundlerArguments() {
- return this.bundlerArguments;
- }
-
@Override
public String toString() {
return "DeployParams {" + "output: " + outdir
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/EnumeratedBundlerParam.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2014, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.jpackage.internal;
-
-import java.util.*;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-
-/**
- * EnumeratedBundlerParams<T>
- *
- * Contains key-value pairs (elements) where keys are "displayable"
- * keys which the IDE can display/choose and values are "identifier" values
- * which can be stored in parameters' map.
- *
- * For instance the Mac has a predefined set of categories which can be applied
- * to LSApplicationCategoryType which is required for the mac app store.
- *
- * The following example illustrates a simple usage of
- * the MAC_CATEGORY parameter:
- *
- * <pre>{@code
- * Set<String> keys = MAC_CATEGORY.getDisplayableKeys();
- *
- * String key = getLastValue(keys); // get last value for example
- *
- * String value = MAC_CATEGORY.getValueForDisplayableKey(key);
- * params.put(MAC_CATEGORY.getID(), value);
- * }</pre>
- *
- */
-class EnumeratedBundlerParam<T> extends BundlerParamInfo<T> {
- // Not sure if this is the correct order, my idea is that from IDE
- // perspective the string to display to the user is the key and then the
- // value is some type of object (although probably a String in most cases)
- private final Map<String, T> elements;
- private final boolean strict;
-
- EnumeratedBundlerParam(String id, Class<T> valueType,
- Function<Map<String, ? super Object>, T> defaultValueFunction,
- BiFunction<String, Map<String, ? super Object>, T> stringConverter,
- Map<String, T> elements, boolean strict) {
- this.id = id;
- this.valueType = valueType;
- this.defaultValueFunction = defaultValueFunction;
- this.stringConverter = stringConverter;
- this.elements = elements;
- this.strict = strict;
- }
-
- boolean isInPossibleValues(T value) {
- return elements.values().contains(value);
- }
-
- // Having the displayable values as the keys seems a bit wacky
- Set<String> getDisplayableKeys() {
- return Collections.unmodifiableSet(elements.keySet());
- }
-
- // mapping from a "displayable" key to an "identifier" value.
- T getValueForDisplayableKey(String displayableKey) {
- return elements.get(displayableKey);
- }
-
- boolean isStrict() {
- return strict;
- }
-
- boolean isLoose() {
- return !isStrict();
- }
-
-}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java Thu Jun 27 17:44:18 2019 -0400
@@ -121,31 +121,6 @@
});
}
- public static void copyFromURL(URL location, File file) throws IOException {
- copyFromURL(location, file, false);
- }
-
- public static void copyFromURL(URL location, File file, boolean append)
- throws IOException {
- if (location == null) {
- throw new IOException("Missing input resource!");
- }
- if (file.exists() && !append) {
- file.delete();
- }
- try (InputStream in = location.openStream();
- FileOutputStream out = new FileOutputStream(file, append)) {
-
- byte[] buffer = new byte[1024];
- int len;
- while ((len = in.read(buffer)) != -1) {
- out.write(buffer, 0, len);
- }
- }
- file.setReadOnly();
- file.setReadable(true, false);
- }
-
public static void copyFile(File sourceFile, File destFile)
throws IOException {
destFile.getParentFile().mkdirs();
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/InvalidBundlerParamException.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2014, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.jpackage.internal;
-
-public class InvalidBundlerParamException extends RuntimeException {
- private static final long serialVersionUID = 1L;
- public InvalidBundlerParamException(String message) {
- super(message);
- }
-}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java Thu Jun 27 17:44:18 2019 -0400
@@ -67,36 +67,6 @@
static final ToolProvider JLINK_TOOL =
ToolProvider.findFirst("jlink").orElseThrow();
- private JLinkBundlerHelper() {}
-
- static String listOfPathToString(List<Path> value) {
- String result = "";
-
- for (Path path : value) {
- if (result.length() > 0) {
- result += File.pathSeparator;
- }
-
- result += path.toString();
- }
-
- return result;
- }
-
- static String setOfStringToString(Set<String> value) {
- String result = "";
-
- for (String element : value) {
- if (result.length() > 0) {
- result += ",";
- }
-
- result += element;
- }
-
- return result;
- }
-
static File getMainJar(Map<String, ? super Object> params) {
File result = null;
RelativeFileSet fileset =
@@ -315,8 +285,6 @@
static final String ALL_DEFAULT = "ALL-DEFAULT";
private final Set<String> modules = new HashSet<>();
- private enum Macros {None, AllModulePath, AllRuntime}
-
ModuleHelper(List<Path> paths, Set<String> addModules,
Set<String> limitModules) {
boolean addAllModulePath = false;
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ModuleManager.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ModuleManager.java Thu Jun 27 17:44:18 2019 -0400
@@ -62,12 +62,6 @@
}
}
- List<ModFile> getModules() {
- return getModules(EnumSet.of(SearchType.UnnamedJar,
- SearchType.ModularJar, SearchType.Jmod,
- SearchType.ExplodedModule));
- }
-
List<ModFile> getModules(EnumSet<SearchType> Search) {
List<ModFile> result = new ArrayList<ModFile>();
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/UnsupportedPlatformException.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2012, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.jpackage.internal;
-
-public class UnsupportedPlatformException extends Exception {
- private static final long serialVersionUID = 1L;
-}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/VersionExtractor.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.jpackage.internal;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class VersionExtractor extends PrintStream {
-
- private static final ResourceBundle I18N = ResourceBundle.getBundle(
- "jdk.jpackage.internal.resources.MainResources");
-
- private final String pattern;
- private String version = null;
-
- public VersionExtractor(String pattern) {
- super(new ByteArrayOutputStream());
-
- this.pattern = pattern;
- }
-
- public String getVersion() {
- if (version == null) {
- String content
- = new String(((ByteArrayOutputStream) out).toByteArray());
- Pattern p = Pattern.compile(pattern);
- Matcher matcher = p.matcher(content);
- if (matcher.find()) {
- version = matcher.group(1);
- }
- }
- return version;
- }
-
- public static boolean isLessThan(String version, String compareTo)
- throws RuntimeException {
- if (version == null || version.isEmpty()) {
- throw new RuntimeException(MessageFormat.format(
- I18N.getString("ERR_VersionComparison"),
- version, compareTo));
- }
-
- if (compareTo == null || compareTo.isEmpty()) {
- throw new RuntimeException(MessageFormat.format(
- I18N.getString("ERR_VersionComparison"),
- version, compareTo));
- }
-
- String [] versionArray = version.trim().split(Pattern.quote("."));
- String [] compareToArray = compareTo.trim().split(Pattern.quote("."));
-
- for (int i = 0; i < versionArray.length; i++) {
- int v1 = Integer.parseInt(versionArray[i]);
- int v2 = Integer.parseInt(compareToArray[i]);
- if (v1 < v2) {
- return true;
- } else if (v1 > v2) {
- return false;
- }
- }
-
- return false;
- }
-}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties Thu Jun 27 17:44:18 2019 -0400
@@ -55,7 +55,6 @@
warning.no.jdk.modules.found=Warning: No JDK Modules found.
MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a bundle.
-MSG_BundlerPlatformException=Bundler {0} skipped because the bundler does not support bundling on this platform.
MSG_BundlerConfigException=Bundler {0} skipped because of a configuration problem: {1}. \n\
Advice to fix: {2}
MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem: {1}.
@@ -78,7 +77,6 @@
ERR_LicenseFileNotExit=Error: Specified license file does not exist.
ERR_BuildRootInvalid=Error: temp-root ({0}) must be non-existant directory.
ERR_InvalidOption=Error: Invalid Option: [{0}].
-ERR_VersionComparison=Error: Failed to compare version {0} with {1}.
ERR_InvalidInstallerType=Error: Invalid or unsupported package type: [{0}].
ERR_BothMainJarAndModule=Error: Cannot have both --main-jar and --module Options.
ERR_NoEntryPoint=Error: creating application image requires --main-jar or --module Option.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties Thu Jun 27 17:44:18 2019 -0400
@@ -55,7 +55,6 @@
warning.no.jdk.modules.found=Warning: No JDK Modules found.
MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a bundle.
-MSG_BundlerPlatformException=Bundler {0} skipped because the bundler does not support bundling on this platform.
MSG_BundlerConfigException=Bundler {0} skipped because of a configuration problem: {1}. \n\
Advice to fix: {2}
MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem: {1}.
@@ -78,7 +77,6 @@
ERR_LicenseFileNotExit=Error: Specified license file does not exist.
ERR_BuildRootInvalid=Error: temp-root ({0}) must be non-existant directory.
ERR_InvalidOption=Error: Invalid Option: [{0}].
-ERR_VersionComparison=Error: Failed to compare version {0} with {1}.
ERR_InvalidInstallerType=Error: Invalid or unsupported package type: [{0}].
ERR_BothMainJarAndModule=Error: Cannot have both --main-jar and --module Options.
ERR_NoEntryPoint=Error: creating application image requires --main-jar or --module Option.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties Thu Jun 27 17:44:18 2019 -0400
@@ -55,7 +55,6 @@
warning.no.jdk.modules.found=Warning: No JDK Modules found.
MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a bundle.
-MSG_BundlerPlatformException=Bundler {0} skipped because the bundler does not support bundling on this platform.
MSG_BundlerConfigException=Bundler {0} skipped because of a configuration problem: {1}. \n\
Advice to fix: {2}
MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem: {1}.
@@ -78,7 +77,6 @@
ERR_LicenseFileNotExit=Error: Specified license file does not exist.
ERR_BuildRootInvalid=Error: temp-root ({0}) must be non-existant directory.
ERR_InvalidOption=Error: Invalid Option: [{0}].
-ERR_VersionComparison=Error: Failed to compare version {0} with {1}.
ERR_InvalidInstallerType=Error: Invalid or unsupported package type: [{0}].
ERR_BothMainJarAndModule=Error: Cannot have both --main-jar and --module Options.
ERR_NoEntryPoint=Error: creating application image requires --main-jar or --module Option.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/main/CommandLine.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/main/CommandLine.java Thu Jun 27 17:44:18 2019 -0400
@@ -36,9 +36,8 @@
/**
* This file is direct copy of CommandLine.java in com.sun.tools.javac.main.
- * It should not be modified other than the package declaration above,
- * the copyright year and this comment.
* It should track changes made to that file.
+ * It is modified only to remove content not used by jpackage
*/
/**
@@ -84,54 +83,6 @@
}
}
- /**
- * Process the given environment variable and appends any Win32-style
- * command files for the specified command line arguments and return
- * the resulting arguments. A command file argument
- * is of the form '@file' where 'file' is the name of the file whose
- * contents are to be parsed for additional arguments. The contents of
- * the command file are parsed using StreamTokenizer and the original
- * '@file' argument replaced with the resulting tokens. Recursive command
- * files are not supported. The '@' character itself can be quoted with
- * the sequence '@@'.
- * @param envVariable the env variable to process
- * @param args the arguments that may contain @files
- * @return the arguments, with environment variable's content and expansion of @files
- * @throws IOException if there is a problem reading any of the @files
- * @throws UnmatchedQuote
- */
- public static List<String> parse(String envVariable, List<String> args)
- throws IOException, UnmatchedQuote {
-
- List<String> inArgs = new ArrayList<>();
- appendParsedEnvVariables(inArgs, envVariable);
- inArgs.addAll(args);
- List<String> newArgs = new ArrayList<>();
- appendParsedCommandArgs(newArgs, inArgs);
- return newArgs;
- }
-
- /**
- * Process the given environment variable and appends any Win32-style
- * command files for the specified command line arguments and return
- * the resulting arguments. A command file argument
- * is of the form '@file' where 'file' is the name of the file whose
- * contents are to be parsed for additional arguments. The contents of
- * the command file are parsed using StreamTokenizer and the original
- * '@file' argument replaced with the resulting tokens. Recursive command
- * files are not supported. The '@' character itself can be quoted with
- * the sequence '@@'.
- * @param envVariable the env variable to process
- * @param args the arguments that may contain @files
- * @return the arguments, with environment variable's content and expansion of @files
- * @throws IOException if there is a problem reading any of the @files
- * @throws UnmatchedQuote
- */
- public static String[] parse(String envVariable, String[] args) throws IOException, UnmatchedQuote {
- List<String> out = parse(envVariable, Arrays.asList(args));
- return out.toArray(new String[out.size()]);
- }
-
private static void loadCmdFile(String name, List<String> args) throws IOException {
try (Reader r = Files.newBufferedReader(Paths.get(name), Charset.defaultCharset())) {
Tokenizer t = new Tokenizer(r);
@@ -249,75 +200,4 @@
}
}
}
-
- @SuppressWarnings("fallthrough")
- private static void appendParsedEnvVariables(List<String> newArgs, String envVariable)
- throws UnmatchedQuote {
-
- if (envVariable == null) {
- return;
- }
- String in = System.getenv(envVariable);
- if (in == null || in.trim().isEmpty()) {
- return;
- }
-
- final char NUL = (char)0;
- final int len = in.length();
-
- int pos = 0;
- StringBuilder sb = new StringBuilder();
- char quote = NUL;
- char ch;
-
- loop:
- while (pos < len) {
- ch = in.charAt(pos);
- switch (ch) {
- case '\"': case '\'':
- if (quote == NUL) {
- quote = ch;
- } else if (quote == ch) {
- quote = NUL;
- } else {
- sb.append(ch);
- }
- pos++;
- break;
- case '\f': case '\n': case '\r': case '\t': case ' ':
- if (quote == NUL) {
- newArgs.add(sb.toString());
- sb.setLength(0);
- while (ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') {
- pos++;
- if (pos >= len) {
- break loop;
- }
- ch = in.charAt(pos);
- }
- break;
- }
- // fall through
- default:
- sb.append(ch);
- pos++;
- }
- }
- if (sb.length() != 0) {
- newArgs.add(sb.toString());
- }
- if (quote != NUL) {
- throw new UnmatchedQuote(envVariable);
- }
- }
-
- public static class UnmatchedQuote extends Exception {
- private static final long serialVersionUID = 0;
-
- public final String variableName;
-
- UnmatchedQuote(String variable) {
- this.variableName = variable;
- }
- }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/VersionExtractor.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.jpackage.internal;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class VersionExtractor extends PrintStream {
+
+ private static final ResourceBundle I18N = ResourceBundle.getBundle(
+ "jdk.jpackage.internal.resources.WinResources");
+
+ private final String pattern;
+ private String version = null;
+
+ public VersionExtractor(String pattern) {
+ super(new ByteArrayOutputStream());
+
+ this.pattern = pattern;
+ }
+
+ public String getVersion() {
+ if (version == null) {
+ String content
+ = new String(((ByteArrayOutputStream) out).toByteArray());
+ Pattern p = Pattern.compile(pattern);
+ Matcher matcher = p.matcher(content);
+ if (matcher.find()) {
+ version = matcher.group(1);
+ }
+ }
+ return version;
+ }
+
+ public static boolean isLessThan(String version, String compareTo)
+ throws RuntimeException {
+ if (version == null || version.isEmpty()) {
+ throw new RuntimeException(MessageFormat.format(
+ I18N.getString("error.version-compare"),
+ version, compareTo));
+ }
+
+ if (compareTo == null || compareTo.isEmpty()) {
+ throw new RuntimeException(MessageFormat.format(
+ I18N.getString("error.version-compare"),
+ version, compareTo));
+ }
+
+ String [] versionArray = version.trim().split(Pattern.quote("."));
+ String [] compareToArray = compareTo.trim().split(Pattern.quote("."));
+
+ for (int i = 0; i < versionArray.length; i++) {
+ int v1 = Integer.parseInt(versionArray[i]);
+ int v2 = Integer.parseInt(compareToArray[i]);
+ if (v1 < v2) {
+ return true;
+ } else if (v1 > v2) {
+ return false;
+ }
+ }
+
+ return false;
+ }
+}
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -58,7 +58,7 @@
@Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
@@ -77,10 +77,7 @@
// to be used by chained bundlers, e.g. by EXE bundler to avoid
// skipping validation if p.type does not include "image"
private boolean doValidate(Map<String, ? super Object> p)
- throws UnsupportedPlatformException, ConfigException {
- if (Platform.getPlatform() != Platform.WINDOWS) {
- throw new UnsupportedPlatformException();
- }
+ throws ConfigException {
imageBundleValidation(p);
@@ -156,14 +153,6 @@
return "bin" + File.separator + getAppName(p) + ".exe";
}
- public static String getLauncherName(Map<String, ? super Object> p) {
- return getAppName(p) + ".exe";
- }
-
- public static String getLauncherCfgName(Map<String, ? super Object> p) {
- return "app" + File.separator + getAppName(p) +".cfg";
- }
-
public boolean bundle(Map<String, ? super Object> p, File outputDirectory)
throws PackagerException {
return doBundle(p, outputDirectory, false) != null;
@@ -210,11 +199,6 @@
}
@Override
- public String getDescription() {
- return I18N.getString("app.bundler.description");
- }
-
- @Override
public String getID() {
return "windows.app";
}
@@ -225,26 +209,6 @@
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- return getAppBundleParameters();
- }
-
- public static Collection<BundlerParamInfo<?>> getAppBundleParameters() {
- return Arrays.asList(
- APP_NAME,
- APP_RESOURCES,
- ARGUMENTS,
- CLASSPATH,
- ICON_ICO,
- JAVA_OPTIONS,
- MAIN_CLASS,
- MAIN_JAR,
- VERSION,
- VERBOSE
- );
- }
-
- @Override
public File execute(Map<String, ? super Object> params,
File outputParentDir) throws PackagerException {
return doBundle(params, outputParentDir, false);
@@ -252,7 +216,7 @@
@Override
public boolean supported(boolean platformInstaller) {
- return (Platform.getPlatform() == Platform.WINDOWS);
+ return true;
}
}
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -68,11 +68,6 @@
}
@Override
- public String getDescription() {
- return getString("exe.bundler.description");
- }
-
- @Override
public String getID() {
return "exe";
}
@@ -83,11 +78,6 @@
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- return new WinMsiBundler().getBundleParameters();
- }
-
- @Override
public File execute(Map<String, ? super Object> params,
File outputParentDir) throws PackagerException {
return bundle(params, outputParentDir);
@@ -95,12 +85,12 @@
@Override
public boolean supported(boolean platformInstaller) {
- return (Platform.getPlatform() == Platform.WINDOWS);
+ return WinMsiBundler.isSupported();
}
@Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
return new WinMsiBundler().validate(params);
}
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java Thu Jun 27 17:44:18 2019 -0400
@@ -167,37 +167,28 @@
+ "C:\\Program Files (x86)\\WiX Toolset v3.7\\bin;"
+ "C:\\Program Files\\WiX Toolset v3.7\\bin";
- public static final BundlerParamInfo<String> TOOL_CANDLE_EXECUTABLE =
- new WindowsBundlerParam<>(
- "win.msi.candle.exe",
- String.class,
- params -> {
- for (String dirString : (System.getenv("PATH") +
- AUTODETECT_DIRS).split(";")) {
- File f = new File(dirString.replace("\"", ""), TOOL_CANDLE);
- if (f.isFile()) {
- return f.toString();
- }
- }
- return null;
- },
- null);
+ private static String getCandlePath() {
+ for (String dirString : (System.getenv("PATH")
+ + AUTODETECT_DIRS).split(";")) {
+ File f = new File(dirString.replace("\"", ""), TOOL_CANDLE);
+ if (f.isFile()) {
+ return f.toString();
+ }
+ }
+ return null;
+ }
- public static final BundlerParamInfo<String> TOOL_LIGHT_EXECUTABLE =
- new WindowsBundlerParam<>(
- "win.msi.light.exe",
- String.class,
- params -> {
- for (String dirString : (System.getenv("PATH") +
- AUTODETECT_DIRS).split(";")) {
- File f = new File(dirString.replace("\"", ""), TOOL_LIGHT);
- if (f.isFile()) {
- return f.toString();
- }
- }
- return null;
- },
- null);
+ private static String getLightPath() {
+ for (String dirString : (System.getenv("PATH")
+ + AUTODETECT_DIRS).split(";")) {
+ File f = new File(dirString.replace("\"", ""), TOOL_LIGHT);
+ if (f.isFile()) {
+ return f.toString();
+ }
+ }
+ return null;
+ }
+
public static final StandardBundlerParam<Boolean> MENU_HINT =
new WindowsBundlerParam<>(
@@ -227,11 +218,6 @@
}
@Override
- public String getDescription() {
- return I18N.getString("msi.bundler.description");
- }
-
- @Override
public String getID() {
return "msi";
}
@@ -242,28 +228,6 @@
}
@Override
- public Collection<BundlerParamInfo<?>> getBundleParameters() {
- Collection<BundlerParamInfo<?>> results = new LinkedHashSet<>();
- results.addAll(WinAppBundler.getAppBundleParameters());
- results.addAll(getMsiBundleParameters());
- return results;
- }
-
- public static Collection<BundlerParamInfo<?>> getMsiBundleParameters() {
- return Arrays.asList(
- DESCRIPTION,
- MENU_GROUP,
- MENU_HINT,
- PRODUCT_VERSION,
- SHORTCUT_HINT,
- MSI_SYSTEM_WIDE,
- VENDOR,
- LICENSE_FILE,
- INSTALLDIR_CHOOSER
- );
- }
-
- @Override
public File execute(Map<String, ? super Object> params,
File outputParentDir) throws PackagerException {
return bundle(params, outputParentDir);
@@ -271,7 +235,15 @@
@Override
public boolean supported(boolean platformInstaller) {
- return (Platform.getPlatform() == Platform.WINDOWS);
+ return isSupported();
+ }
+
+ public static boolean isSupported() {
+ try {
+ return validateWixTools();
+ } catch (Exception e) {
+ return false;
+ }
}
private static String findToolVersion(String toolName) {
@@ -297,9 +269,31 @@
}
}
+ public static boolean validateWixTools() {
+ String candleVersion = findToolVersion(getCandlePath());
+ String lightVersion = findToolVersion(getLightPath());
+
+ // WiX 3.0+ is required
+ String minVersion = "3.0";
+
+ if (VersionExtractor.isLessThan(candleVersion, minVersion)) {
+ Log.verbose(MessageFormat.format(
+ I18N.getString("message.wrong-tool-version"),
+ TOOL_CANDLE, candleVersion, minVersion));
+ return false;
+ }
+ if (VersionExtractor.isLessThan(lightVersion, minVersion)) {
+ Log.verbose(MessageFormat.format(
+ I18N.getString("message.wrong-tool-version"),
+ TOOL_LIGHT, lightVersion, minVersion));
+ return false;
+ }
+ return true;
+ }
+
@Override
public boolean validate(Map<String, ? super Object> params)
- throws UnsupportedPlatformException, ConfigException {
+ throws ConfigException {
try {
if (params == null) throw new ConfigException(
I18N.getString("error.parameters-null"),
@@ -307,36 +301,13 @@
// run basic validation to ensure requirements are met
// we are not interested in return code, only possible exception
- APP_BUNDLER.fetchFrom(params).validate(params);
-
- String candleVersion =
- findToolVersion(TOOL_CANDLE_EXECUTABLE.fetchFrom(params));
- String lightVersion =
- findToolVersion(TOOL_LIGHT_EXECUTABLE.fetchFrom(params));
-
- // WiX 3.0+ is required
- String minVersion = "3.0";
- boolean bad = false;
-
- if (VersionExtractor.isLessThan(candleVersion, minVersion)) {
- Log.verbose(MessageFormat.format(
- I18N.getString("message.wrong-tool-version"),
- TOOL_CANDLE, candleVersion, minVersion));
- bad = true;
- }
- if (VersionExtractor.isLessThan(lightVersion, minVersion)) {
- Log.verbose(MessageFormat.format(
- I18N.getString("message.wrong-tool-version"),
- TOOL_LIGHT, lightVersion, minVersion));
- bad = true;
- }
-
- if (bad){
+ if (!validateWixTools()){
throw new ConfigException(
I18N.getString("error.no-wix-tools"),
I18N.getString("error.no-wix-tools.advice"));
}
+ String lightVersion = findToolVersion(getLightPath());
if (!VersionExtractor.isLessThan(lightVersion, "3.6")) {
Log.verbose(I18N.getString("message.use-wix36-features"));
params.put(CAN_USE_WIX36.getID(), Boolean.TRUE);
@@ -491,8 +462,8 @@
IOUtils.writableOutputDir(outdir.toPath());
// validate we have valid tools before continuing
- String light = TOOL_LIGHT_EXECUTABLE.fetchFrom(params);
- String candle = TOOL_CANDLE_EXECUTABLE.fetchFrom(params);
+ String light = getLightPath();
+ String candle = getCandlePath();
if (light == null || !new File(light).isFile() ||
candle == null || !new File(candle).isFile()) {
Log.verbose(MessageFormat.format(
@@ -1043,7 +1014,7 @@
msiOut.getParentFile().mkdirs();
List<String> commandLine = new ArrayList<>(Arrays.asList(
- TOOL_CANDLE_EXECUTABLE.fetchFrom(params),
+ getCandlePath(),
"-nologo",
getConfig_ProjectFile(params).getAbsolutePath(),
"-ext", "WixUtilExtension",
@@ -1064,7 +1035,7 @@
commandLine = new ArrayList<>();
- commandLine.add(TOOL_LIGHT_EXECUTABLE.fetchFrom(params));
+ commandLine.add(getLightPath());
commandLine.add("-nologo");
commandLine.add("-spdb");
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java Thu Jun 27 17:44:18 2019 -0400
@@ -147,45 +147,12 @@
Files.createDirectories(runtimeDir);
}
- private Path destFile(String dir, String filename) {
- return runtimeDir.resolve(dir).resolve(filename);
- }
-
private void writeEntry(InputStream in, Path dstFile) throws IOException {
Files.createDirectories(dstFile.getParent());
Files.copy(in, dstFile);
}
- private void writeSymEntry(Path dstFile, Path target) throws IOException {
- Files.createDirectories(dstFile.getParent());
- Files.createLink(dstFile, target);
- }
-
- /**
- * chmod ugo+x file
- */
- private void setExecutable(Path file) {
- try {
- Set<PosixFilePermission> perms =
- Files.getPosixFilePermissions(file);
- perms.add(PosixFilePermission.OWNER_EXECUTE);
- perms.add(PosixFilePermission.GROUP_EXECUTE);
- perms.add(PosixFilePermission.OTHERS_EXECUTE);
- Files.setPosixFilePermissions(file, perms);
- } catch (IOException ioe) {
- throw new UncheckedIOException(ioe);
- }
- }
-
- private static void createUtf8File(File file, String content)
- throws IOException {
- try (OutputStream fout = new FileOutputStream(file);
- Writer output = new OutputStreamWriter(fout, "UTF-8")) {
- output.write(content);
- }
- }
-
- public static String getLauncherName(Map<String, ? super Object> params) {
+ private static String getLauncherName(Map<String, ? super Object> params) {
return APP_NAME.fetchFrom(params) + ".exe";
}
@@ -286,25 +253,6 @@
}
}
- private boolean copyMSVCDLLs(String VS_VER) throws IOException {
- final InputStream REDIST_MSVCR_URL = getResourceAsStream(
- REDIST_MSVCR.replaceAll("VS_VER", VS_VER));
- final InputStream REDIST_MSVCP_URL = getResourceAsStream(
- REDIST_MSVCP.replaceAll("VS_VER", VS_VER));
-
- if (REDIST_MSVCR_URL != null && REDIST_MSVCP_URL != null) {
- Files.copy(
- REDIST_MSVCR_URL,
- binDir.resolve(REDIST_MSVCR.replaceAll("VS_VER", VS_VER)));
- Files.copy(
- REDIST_MSVCP_URL,
- binDir.resolve(REDIST_MSVCP.replaceAll("VS_VER", VS_VER)));
- return true;
- }
-
- return false;
- }
-
private void validateValueAndPut(
Map<String, String> data, String key,
BundlerParamInfo<String> param,
@@ -415,6 +363,7 @@
}
}
} finally {
+ executableFile.toFile().setExecutable(true);
executableFile.toFile().setReadOnly();
}
}
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources.properties Thu Jun 27 17:44:18 2019 -0400
@@ -25,11 +25,8 @@
#
app.bundler.name=Windows Application Image
-app.bundler.description=A Directory based image of a windows Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
exe.bundler.name=EXE Installer
-exe.bundler.description=Microsoft Windows EXE Installer, via InnoIDE.
msi.bundler.name=MSI Installer
-msi.bundler.description=Microsoft Windows MSI Installer, via WiX.
param.menu-group.default=Unknown
@@ -58,6 +55,7 @@
error.version-string-part-not-number=Failed to convert version component to int.
error.cannot-walk-directory=Can not walk [{0}] - it is not a valid directory.
error.version-swap=Failed to update version information for {0}.
+error.version-compare=Error: Failed to compare version {0} with {1}.
message.result-dir=Result application bundle: {0}.
message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place.
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_ja.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_ja.properties Thu Jun 27 17:44:18 2019 -0400
@@ -25,11 +25,8 @@
#
app.bundler.name=Windows Application Image
-app.bundler.description=A Directory based image of a windows Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
exe.bundler.name=EXE Installer
-exe.bundler.description=Microsoft Windows EXE Installer, via InnoIDE.
msi.bundler.name=MSI Installer
-msi.bundler.description=Microsoft Windows MSI Installer, via WiX.
param.menu-group.default=Unknown
@@ -58,6 +55,7 @@
error.version-string-part-not-number=Failed to convert version component to int.
error.cannot-walk-directory=Can not walk [{0}] - it is not a valid directory.
error.version-swap=Failed to update version information for {0}.
+error.version-compare=Error: Failed to compare version {0} with {1}.
message.result-dir=Result application bundle: {0}.
message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place.
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_zh_CN.properties Fri Jun 21 10:14:49 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_zh_CN.properties Thu Jun 27 17:44:18 2019 -0400
@@ -25,11 +25,8 @@
#
app.bundler.name=Windows Application Image
-app.bundler.description=A Directory based image of a windows Application with an optionally co-bundled JRE. Used as a base for the Installer bundlers.
exe.bundler.name=EXE Installer
-exe.bundler.description=Microsoft Windows EXE Installer, via InnoIDE.
msi.bundler.name=MSI Installer
-msi.bundler.description=Microsoft Windows MSI Installer, via WiX.
param.menu-group.default=Unknown
@@ -58,6 +55,7 @@
error.version-string-part-not-number=Failed to convert version component to int.
error.cannot-walk-directory=Can not walk [{0}] - it is not a valid directory.
error.version-swap=Failed to update version information for {0}.
+error.version-compare=Error: Failed to compare version {0} with {1}.
message.result-dir=Result application bundle: {0}.
message.icon-not-ico=The specified icon "{0}" is not an ICO file and will not be used. The default icon will be used in it's place.
--- a/test/jdk/tools/jpackage/JPackageInvalidArgTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/JPackageInvalidArgTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -36,7 +36,7 @@
private static final String ARG2 = "--output";
private static final String RESULT1 =
"Invalid Option: [--no-such-argument]";
- private static final String RESULT2 = "Missing argument:";
+ private static final String RESULT2 = "--main-jar or --module";
private static void validate(String arg, String output) throws Exception {
String[] result = JPackageHelper.splitAndFilter(output);
--- a/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageAddLauncherModuleTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageAddLauncherModuleTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -43,9 +43,8 @@
public static void main(String[] args) throws Exception {
JPackageHelper.createHelloModule();
JPackageCreateAppImageAddLauncherBase.createSLProperties();
- JPackageCreateAppImageAddLauncherBase.testCreateAppImage(CMD);
- JPackageHelper.deleteOutputFolder(OUTPUT);
- JPackageCreateAppImageAddLauncherBase.testCreateAppImageToolProvider(CMD);
+ JPackageCreateAppImageAddLauncherBase.testCreateAppImageToolProvider(
+ CMD);
}
}
--- a/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageAddLauncherTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageAddLauncherTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -45,8 +45,6 @@
JPackageHelper.createHelloImageJar();
JPackageCreateAppImageAddLauncherBase.createSLProperties();
JPackageCreateAppImageAddLauncherBase.testCreateAppImage(CMD);
- JPackageHelper.deleteOutputFolder(OUTPUT);
- JPackageCreateAppImageAddLauncherBase.testCreateAppImageToolProvider(CMD);
}
}
--- a/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageErrorTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageErrorTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -45,7 +45,7 @@
private static final String EXPECTED1 =
"Invalid Option: [--no-such-argument]";
private static final String ARG2 = "--output";
- private static final String EXPECTED2 = "Missing argument:";
+ private static final String EXPECTED2 = "--main-jar or --module";
private static final String [] CMD1 = {
"--input", "input",
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/base/JPLinuxAssociationsBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Desktop;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPLinuxAssociationsBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String TEST_EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT.toLowerCase());
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void validateAppOutput() throws Exception {
+ File outFile = new File("appOutput.txt");
+ int count = 10;
+ boolean bOutputCreated = false;
+ while (count > 0) {
+ if (!outFile.exists()) {
+ Thread.sleep(3000);
+ count--;
+ } else {
+ bOutputCreated = true;
+ break;
+ }
+ }
+
+ if (!bOutputCreated) {
+ throw new AssertionError(outFile.getAbsolutePath() + " was not created");
+ }
+
+ String output = Files.readString(outFile.toPath());
+ String[] result = output.split("\n");
+ if (result.length != 3) {
+ System.err.println(output);
+ throw new AssertionError(
+ "Unexpected number of lines: " + result.length);
+ }
+
+ if (!result[0].trim().equals("jpackage test application")) {
+ throw new AssertionError("Unexpected result[0]: " + result[0]);
+ }
+
+ if (!result[1].trim().equals("args.length: 1")) {
+ throw new AssertionError("Unexpected result[1]: " + result[1]);
+ }
+
+ File faFile = new File(TEST_NAME + "." + TEST_EXT);
+ if (!result[2].trim().equals(faFile.getAbsolutePath())) {
+ throw new AssertionError("Unexpected result[2]: " + result[2]);
+ }
+ }
+
+ private static void verifyInstall() throws Exception {
+ createAssociationsTestFile();
+ Desktop.getDesktop().open(new File(TEST_NAME + "." + TEST_EXT));
+ validateAppOutput();
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
+ File folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+ }
+
+ private static void createAssociationsTestFile() throws Exception {
+ try (PrintWriter out = new PrintWriter(new BufferedWriter(
+ new FileWriter(TEST_NAME + "." + TEST_EXT)))) {
+ out.println(TEST_NAME);
+ }
+ }
+
+ private static void createAssociationsProperties() throws Exception {
+ try (PrintWriter out = new PrintWriter(new BufferedWriter(
+ new FileWriter("fa.properties")))) {
+ out.println("extension=" + TEST_EXT);
+ out.println("mime-type=application/" + TEST_EXT);
+ out.println("description=jpackage test extention");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ TEST_EXT = "jptest1";
+ if (EXT.equals("rpm")) {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
+ } else {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ }
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--file-associations", "fa.properties"};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ createAssociationsProperties();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/base/JPLinuxBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPLinuxBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT.toLowerCase());
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
+ File folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ if (EXT.equals("rpm")) {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
+ } else {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ }
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello" };
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/base/JPLinuxBundleNameBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPLinuxBundleNameBase {
+
+ private static String TEST_NAME;
+ private static String BUNDLE_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT.toLowerCase());
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
+ File folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ BUNDLE_NAME = "jpackage-test-bundle-name";
+ EXT = ext;
+ if (EXT.equals("rpm")) {
+ OUTPUT = "output" + File.separator + BUNDLE_NAME + "-1.0-1.x86_64." + EXT;
+ } else {
+ OUTPUT = "output" + File.separator + BUNDLE_NAME + "-1.0." + EXT;
+ }
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--linux-bundle-name", BUNDLE_NAME};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/base/JPLinuxInstallDirBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPLinuxInstallDirBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT.toLowerCase());
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getLinuxInstalledApp("jpackage", TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ String folderPath = JPackagePath.getLinuxInstallFolder("jpackage", TEST_NAME);
+ File folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+
+ folderPath = JPackagePath.getLinuxInstallFolder("jpackage", null);
+ folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ if (EXT.equals("rpm")) {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
+ } else {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ }
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--install-dir", "/opt/jpackage"};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/base/JPLinuxLicenseBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPLinuxLicenseBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT.toLowerCase());
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
+ File folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ if (EXT.equals("rpm")) {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
+ } else {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ }
+ CMD = new String [] {
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--license-file", JPackagePath.getLicenseFilePath()};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/base/JPLinuxLicenseTypeBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPLinuxLicenseTypeBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String JP_LICENSE_TYPE;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT.toLowerCase());
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static final String infoResult = "infoResult.txt";
+ private static void validatePackage() throws Exception {
+ int retVal = JPackageHelper.execute(new File(infoResult),"rpm",
+ "--query", "--package", "--info", OUTPUT.toLowerCase());
+ if (retVal != 0) {
+ throw new AssertionError("rpm exited with error: " + retVal);
+ }
+
+ File outfile = new File(infoResult);
+ if (!outfile.exists()) {
+ throw new AssertionError(infoResult + " was not created");
+ }
+
+ String output = Files.readString(outfile.toPath());
+ if (!output.contains(JP_LICENSE_TYPE)) {
+ throw new AssertionError("Unexpected result: " + output);
+ }
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ validatePackage();
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
+ File folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ JP_LICENSE_TYPE = "JP_LICENSE_TYPE";
+ if (EXT.equals("rpm")) {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
+ } else {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ }
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--linux-rpm-license-type", JP_LICENSE_TYPE};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/base/JPLinuxMaintainerBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPLinuxMaintainerBase {
+
+ private static String TEST_NAME;
+ private static String EMAIL;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT.toLowerCase());
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static final String infoResult = "infoResult.txt";
+ private static void validatePackage() throws Exception {
+ int retVal = JPackageHelper.execute(new File(infoResult), "dpkg",
+ "--info", OUTPUT.toLowerCase());
+ if (retVal != 0) {
+ throw new AssertionError("dpkg exited with error: " + retVal);
+ }
+
+ File outfile = new File(infoResult);
+ if (!outfile.exists()) {
+ throw new AssertionError(infoResult + " was not created");
+ }
+
+ String output = Files.readString(outfile.toPath());
+ if (!output.contains("Maintainer: " + EMAIL)) {
+ throw new AssertionError("Unexpected result: " + output);
+ }
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ validatePackage();
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
+ File folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EMAIL = "jpackage-test@java.com";
+ EXT = ext;
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--linux-deb-maintainer", EMAIL};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/base/JPLinuxPackageDepsBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPLinuxPackageDepsBase {
+
+ private static String TEST_NAME;
+ private static String DEP_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String OUTPUT_DEP;
+ private static String[] CMD;
+ private static String[] CMD_DEP;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT.toLowerCase());
+ files.add(OUTPUT_DEP.toLowerCase());
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static final String infoResult = "infoResult.txt";
+ private static void validatePackage() throws Exception {
+ if (EXT.equals("rpm")) {
+ int retVal = JPackageHelper.execute(new File(infoResult),"rpm",
+ "--query", "--package", "--requires", OUTPUT.toLowerCase());
+ if (retVal != 0) {
+ throw new AssertionError("rpm exited with error: " + retVal);
+ }
+ } else {
+ int retVal = JPackageHelper.execute(new File(infoResult), "dpkg",
+ "--info", OUTPUT.toLowerCase());
+ if (retVal != 0) {
+ throw new AssertionError("dpkg exited with error: " + retVal);
+ }
+ }
+
+ File outfile = new File(infoResult);
+ if (!outfile.exists()) {
+ throw new AssertionError(infoResult + " was not created");
+ }
+
+ String output = Files.readString(outfile.toPath());
+ if (!output.contains(DEP_NAME.toLowerCase())) {
+ throw new AssertionError("Unexpected result: " + output);
+ }
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageHelper.executeCLI(true, CMD_DEP);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ JPackageInstallerHelper.validateOutput(OUTPUT_DEP);
+ validatePackage();
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+
+ app = JPackagePath.getLinuxInstalledApp(DEP_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
+ File folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+
+ folderPath = JPackagePath.getLinuxInstallFolder(DEP_NAME);
+ folder = new File(folderPath);
+ if (folder.exists()) {
+ throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ DEP_NAME = name + "Dep";
+ EXT = ext;
+ if (EXT.equals("rpm")) {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
+ OUTPUT_DEP = "output" + File.separator + DEP_NAME + "-1.0-1.x86_64." + EXT;
+ } else {
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ OUTPUT_DEP = "output" + File.separator + DEP_NAME + "-1.0." + EXT;
+ }
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--linux-package-deps", DEP_NAME.toLowerCase()};
+ CMD_DEP = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", DEP_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello"};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- a/test/jdk/tools/jpackage/createinstaller/linux/base/JPackageCreateInstallerBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT.toLowerCase());
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
- File folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- if (EXT.equals("rpm")) {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
- } else {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- }
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello" };
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/base/JPackageCreateInstallerBundleNameBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerBundleNameBase {
-
- private static String TEST_NAME;
- private static String BUNDLE_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT.toLowerCase());
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
- File folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- BUNDLE_NAME = "jpackage-test-bundle-name";
- EXT = ext;
- if (EXT.equals("rpm")) {
- OUTPUT = "output" + File.separator + BUNDLE_NAME + "-1.0-1.x86_64." + EXT;
- } else {
- OUTPUT = "output" + File.separator + BUNDLE_NAME + "-1.0." + EXT;
- }
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--linux-bundle-name", BUNDLE_NAME};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/base/JPackageCreateInstallerFileAssociationsBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.Desktop;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerFileAssociationsBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String TEST_EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT.toLowerCase());
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void validateAppOutput() throws Exception {
- File outFile = new File("appOutput.txt");
- int count = 10;
- boolean bOutputCreated = false;
- while (count > 0) {
- if (!outFile.exists()) {
- Thread.sleep(3000);
- count--;
- } else {
- bOutputCreated = true;
- break;
- }
- }
-
- if (!bOutputCreated) {
- throw new AssertionError(outFile.getAbsolutePath() + " was not created");
- }
-
- String output = Files.readString(outFile.toPath());
- String[] result = output.split("\n");
- if (result.length != 3) {
- System.err.println(output);
- throw new AssertionError(
- "Unexpected number of lines: " + result.length);
- }
-
- if (!result[0].trim().equals("jpackage test application")) {
- throw new AssertionError("Unexpected result[0]: " + result[0]);
- }
-
- if (!result[1].trim().equals("args.length: 1")) {
- throw new AssertionError("Unexpected result[1]: " + result[1]);
- }
-
- File faFile = new File(TEST_NAME + "." + TEST_EXT);
- if (!result[2].trim().equals(faFile.getAbsolutePath())) {
- throw new AssertionError("Unexpected result[2]: " + result[2]);
- }
- }
-
- private static void verifyInstall() throws Exception {
- createFileAssociationsTestFile();
- Desktop.getDesktop().open(new File(TEST_NAME + "." + TEST_EXT));
- validateAppOutput();
- }
-
- private static void verifyUnInstall() throws Exception {
- String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
- File folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
- }
-
- private static void createFileAssociationsTestFile() throws Exception {
- try (PrintWriter out = new PrintWriter(new BufferedWriter(
- new FileWriter(TEST_NAME + "." + TEST_EXT)))) {
- out.println(TEST_NAME);
- }
- }
-
- private static void createFileAssociationsProperties() throws Exception {
- try (PrintWriter out = new PrintWriter(new BufferedWriter(
- new FileWriter("fa.properties")))) {
- out.println("extension=" + TEST_EXT);
- out.println("mime-type=application/" + TEST_EXT);
- out.println("description=jpackage test extention");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- TEST_EXT = "jptest1";
- if (EXT.equals("rpm")) {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
- } else {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- }
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--file-associations", "fa.properties"};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- createFileAssociationsProperties();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/base/JPackageCreateInstallerInstallDirBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerInstallDirBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT.toLowerCase());
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getLinuxInstalledApp("jpackage", TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- String folderPath = JPackagePath.getLinuxInstallFolder("jpackage", TEST_NAME);
- File folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
-
- folderPath = JPackagePath.getLinuxInstallFolder("jpackage", null);
- folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- if (EXT.equals("rpm")) {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
- } else {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- }
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--install-dir", "/opt/jpackage"};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/base/JPackageCreateInstallerLicenseBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerLicenseBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT.toLowerCase());
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
-
- }
-
- private static void verifyUnInstall() throws Exception {
- String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
- File folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- if (EXT.equals("rpm")) {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
- } else {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- }
- CMD = new String [] {
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--license-file", JPackagePath.getLicenseFilePath()};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/base/JPackageCreateInstallerLicenseTypeBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerLicenseTypeBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String JP_LICENSE_TYPE;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT.toLowerCase());
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static final String infoResult = "infoResult.txt";
- private static void validatePackage() throws Exception {
- int retVal = JPackageHelper.execute(new File(infoResult),"rpm",
- "--query", "--package", "--info", OUTPUT.toLowerCase());
- if (retVal != 0) {
- throw new AssertionError("rpm exited with error: " + retVal);
- }
-
- File outfile = new File(infoResult);
- if (!outfile.exists()) {
- throw new AssertionError(infoResult + " was not created");
- }
-
- String output = Files.readString(outfile.toPath());
- if (!output.contains(JP_LICENSE_TYPE)) {
- throw new AssertionError("Unexpected result: " + output);
- }
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- validatePackage();
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
- File folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- JP_LICENSE_TYPE = "JP_LICENSE_TYPE";
- if (EXT.equals("rpm")) {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
- } else {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- }
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--linux-rpm-license-type", JP_LICENSE_TYPE};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/base/JPackageCreateInstallerMaintainerBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerMaintainerBase {
-
- private static String TEST_NAME;
- private static String EMAIL;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT.toLowerCase());
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static final String infoResult = "infoResult.txt";
- private static void validatePackage() throws Exception {
- int retVal = JPackageHelper.execute(new File(infoResult), "dpkg",
- "--info", OUTPUT.toLowerCase());
- if (retVal != 0) {
- throw new AssertionError("dpkg exited with error: " + retVal);
- }
-
- File outfile = new File(infoResult);
- if (!outfile.exists()) {
- throw new AssertionError(infoResult + " was not created");
- }
-
- String output = Files.readString(outfile.toPath());
- if (!output.contains("Maintainer: " + EMAIL)) {
- throw new AssertionError("Unexpected result: " + output);
- }
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- validatePackage();
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
- File folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EMAIL = "jpackage-test@java.com";
- EXT = ext;
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--linux-deb-maintainer", EMAIL};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/base/JPackageCreateInstallerPackageDepsBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerPackageDepsBase {
-
- private static String TEST_NAME;
- private static String DEP_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String OUTPUT_DEP;
- private static String[] CMD;
- private static String[] CMD_DEP;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT.toLowerCase());
- files.add(OUTPUT_DEP.toLowerCase());
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static final String infoResult = "infoResult.txt";
- private static void validatePackage() throws Exception {
- if (EXT.equals("rpm")) {
- int retVal = JPackageHelper.execute(new File(infoResult),"rpm",
- "--query", "--package", "--requires", OUTPUT.toLowerCase());
- if (retVal != 0) {
- throw new AssertionError("rpm exited with error: " + retVal);
- }
- } else {
- int retVal = JPackageHelper.execute(new File(infoResult), "dpkg",
- "--info", OUTPUT.toLowerCase());
- if (retVal != 0) {
- throw new AssertionError("dpkg exited with error: " + retVal);
- }
- }
-
- File outfile = new File(infoResult);
- if (!outfile.exists()) {
- throw new AssertionError(infoResult + " was not created");
- }
-
- String output = Files.readString(outfile.toPath());
- if (!output.contains(DEP_NAME.toLowerCase())) {
- throw new AssertionError("Unexpected result: " + output);
- }
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageHelper.executeCLI(true, CMD_DEP);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- JPackageInstallerHelper.validateOutput(OUTPUT_DEP);
- validatePackage();
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getLinuxInstalledApp(TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
-
- app = JPackagePath.getLinuxInstalledApp(DEP_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- String folderPath = JPackagePath.getLinuxInstallFolder(TEST_NAME);
- File folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
-
- folderPath = JPackagePath.getLinuxInstallFolder(DEP_NAME);
- folder = new File(folderPath);
- if (folder.exists()) {
- throw new AssertionError("Error: " + folder.getAbsolutePath() + " exist");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- DEP_NAME = name + "Dep";
- EXT = ext;
- if (EXT.equals("rpm")) {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0-1.x86_64." + EXT;
- OUTPUT_DEP = "output" + File.separator + DEP_NAME + "-1.0-1.x86_64." + EXT;
- } else {
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- OUTPUT_DEP = "output" + File.separator + DEP_NAME + "-1.0." + EXT;
- }
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--linux-package-deps", DEP_NAME.toLowerCase()};
- CMD_DEP = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", DEP_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello"};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/JPLinuxDebAssociationsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxAssociationsBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPLinuxDebAssociationsTest
+ */
+public class JPLinuxDebAssociationsTest {
+ private static final String TEST_NAME = "JPLinuxDebAssociationsTest";
+ private static final String EXT = "deb";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.LinuxDebBundler.isSupported()) {
+ JPLinuxAssociationsBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/JPLinuxDebBundleNameTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxBundleNameBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPLinuxDebBundleNameTest
+ */
+public class JPLinuxDebBundleNameTest {
+ private static final String TEST_NAME = "JPLinuxDebBundleNameTest";
+ private static final String EXT = "deb";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.LinuxDebBundler.isSupported()) {
+ JPLinuxBundleNameBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/JPLinuxDebInstallDirTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxInstallDirBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPLinuxDebInstallDirTest
+ */
+public class JPLinuxDebInstallDirTest {
+ private static final String TEST_NAME = "JPLinuxDebInstallDirTest";
+ private static final String EXT = "deb";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.LinuxDebBundler.isSupported()) {
+ JPLinuxInstallDirBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/JPLinuxDebLicenseTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxLicenseBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPLinuxDebLicenseTest
+ */
+public class JPLinuxDebLicenseTest {
+ private static final String TEST_NAME = "JPLinuxDebLicenseTest";
+ private static final String EXT = "deb";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.LinuxDebBundler.isSupported()) {
+ JPLinuxLicenseBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/JPLinuxDebMaintainerTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxMaintainerBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPLinuxDebMaintainerTest
+ */
+public class JPLinuxDebMaintainerTest {
+ private static final String TEST_NAME = "JPLinuxDebMaintainerTest";
+ private static final String EXT = "deb";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.LinuxDebBundler.isSupported()) {
+ JPLinuxMaintainerBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/JPLinuxDebPackageDepsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxPackageDepsBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm/timeout=240 -Xmx512m JPLinuxDebPackageDepsTest
+ */
+public class JPLinuxDebPackageDepsTest {
+ private static final String TEST_NAME = "JPLinuxDebPackageDepsTest";
+ private static final String EXT = "deb";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.LinuxDebBundler.isSupported()) {
+ JPLinuxPackageDepsBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/JPLinuxDebTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPLinuxDebTest
+ */
+public class JPLinuxDebTest {
+ private static final String TEST_NAME = "JPLinuxDebTest";
+ private static final String EXT = "deb";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.LinuxDebBundler.isSupported()) {
+ JPLinuxBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/JPackageCreateInstallerBundleNameTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerBundleNameBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerBundleNameTest
- */
-public class JPackageCreateInstallerBundleNameTest {
- private static final String TEST_NAME = "JPackageCreateInstallerBundleNameTest";
- private static final String EXT = "deb";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerBundleNameBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/JPackageCreateInstallerFileAssociationsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerFileAssociationsBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerFileAssociationsTest
- */
-public class JPackageCreateInstallerFileAssociationsTest {
- private static final String TEST_NAME = "JPackageCreateInstallerFileAssociationsTest";
- private static final String EXT = "deb";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/JPackageCreateInstallerInstallDirTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerInstallDirBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerInstallDirTest
- */
-public class JPackageCreateInstallerInstallDirTest {
- private static final String TEST_NAME = "JPackageCreateInstallerInstallDirTest";
- private static final String EXT = "deb";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerInstallDirBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/JPackageCreateInstallerLicenseTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerLicenseBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerLicenseTest
- */
-public class JPackageCreateInstallerLicenseTest {
- private static final String TEST_NAME = "JPackageCreateInstallerLicenseTest";
- private static final String EXT = "deb";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerLicenseBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/JPackageCreateInstallerMaintainerTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerMaintainerBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerMaintainerTest
- */
-public class JPackageCreateInstallerMaintainerTest {
- private static final String TEST_NAME = "JPackageCreateInstallerMaintainerTest";
- private static final String EXT = "deb";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerMaintainerBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/JPackageCreateInstallerPackageDepsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerPackageDepsBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm/timeout=240 -Xmx512m JPackageCreateInstallerPackageDepsTest
- */
-public class JPackageCreateInstallerPackageDepsTest {
- private static final String TEST_NAME = "JPackageCreateInstallerPackageDepsTest";
- private static final String EXT = "deb";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerPackageDepsBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/JPackageCreateInstallerTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerTest
- */
-public class JPackageCreateInstallerTest {
- private static final String TEST_NAME = "JPackageCreateInstallerTest";
- private static final String EXT = "deb";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/install.sh Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/install.sh Thu Jun 27 17:44:18 2019 -0400
@@ -1,8 +1,8 @@
-sudo dpkg -i jpackagecreateinstallertest-1.0.deb
-sudo dpkg -i jpackagecreateinstallerfileassociationstest-1.0.deb
-sudo dpkg -i jpackagecreateinstallerlicensetest-1.0.deb
-sudo dpkg -i jpackagecreateinstallerinstalldirtest-1.0.deb
+sudo dpkg -i jplinuxdebtest-1.0.deb
+sudo dpkg -i jplinuxdebassociationstest-1.0.deb
+sudo dpkg -i jplinuxdeblicensetest-1.0.deb
+sudo dpkg -i jplinuxdebinstalldirtest-1.0.deb
sudo dpkg -i jpackage-test-bundle-name-1.0.deb
-sudo dpkg -i jpackagecreateinstallermaintainertest-1.0.deb
-sudo dpkg -i jpackagecreateinstallerpackagedepstestdep-1.0.deb
-sudo dpkg -i jpackagecreateinstallerpackagedepstest-1.0.deb
\ No newline at end of file
+sudo dpkg -i jplinuxdebmaintainertest-1.0.deb
+sudo dpkg -i jplinuxdebpackagedepstestdep-1.0.deb
+sudo dpkg -i jplinuxdebpackagedepstest-1.0.deb
--- a/test/jdk/tools/jpackage/createinstaller/linux/deb/uninstall.sh Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/linux/deb/uninstall.sh Thu Jun 27 17:44:18 2019 -0400
@@ -1,8 +1,8 @@
-sudo dpkg -r jpackagecreateinstallertest
-sudo dpkg -r jpackagecreateinstallerfileassociationstest
-sudo dpkg -r jpackagecreateinstallerlicensetest
-sudo dpkg -r jpackagecreateinstallerinstalldirtest
+sudo dpkg -r jplinuxdebtest
+sudo dpkg -r jplinuxdebassociationstest
+sudo dpkg -r jplinuxdeblicensetest
+sudo dpkg -r jplinuxdebinstalldirtest
sudo dpkg -r jpackage-test-bundle-name
-sudo dpkg -r jpackagecreateinstallermaintainertest
-sudo dpkg -r jpackagecreateinstallerpackagedepstest
-sudo dpkg -r jpackagecreateinstallerpackagedepstestdep
+sudo dpkg -r jplinuxdebmaintainertest
+sudo dpkg -r jplinuxdebpackagedepstest
+sudo dpkg -r jplinuxdebpackagedepstestdep
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPLinuxRpmAssociationsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxAssociationsBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPLinuxRpmAssociationsTest
+ */
+public class JPLinuxRpmAssociationsTest {
+ private static final String TEST_NAME = "JPLinuxRpmAssociationsTest";
+ private static final String EXT = "rpm";
+
+ public static void main(String[] args) throws Exception {
+ JPLinuxAssociationsBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPLinuxRpmBundleNameTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxBundleNameBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPLinuxRpmBundleNameTest
+ */
+public class JPLinuxRpmBundleNameTest {
+ private static final String TEST_NAME = "JPLinuxRpmBundleNameTest";
+ private static final String EXT = "rpm";
+
+ public static void main(String[] args) throws Exception {
+ JPLinuxBundleNameBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPLinuxRpmInstallDirTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxInstallDirBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPLinuxRpmInstallDirTest
+ */
+public class JPLinuxRpmInstallDirTest {
+ private static final String TEST_NAME = "JPLinuxRpmInstallDirTest";
+ private static final String EXT = "rpm";
+
+ public static void main(String[] args) throws Exception {
+ JPLinuxInstallDirBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPLinuxRpmLicenseTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxLicenseBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPLinuxRpmLicenseTest
+ */
+public class JPLinuxRpmLicenseTest {
+ private static final String TEST_NAME = "JPLinuxRpmLicenseTest";
+ private static final String EXT = "rpm";
+
+ public static void main(String[] args) throws Exception {
+ JPLinuxLicenseBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPLinuxRpmLicenseTypeTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxLicenseTypeBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPLinuxRpmLicenseTypeTest
+ */
+public class JPLinuxRpmLicenseTypeTest {
+ private static final String TEST_NAME = "JPLinuxRpmLicenseTypeTest";
+ private static final String EXT = "rpm";
+
+ public static void main(String[] args) throws Exception {
+ JPLinuxLicenseTypeBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPLinuxRpmPackageDepsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxPackageDepsBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @run main/othervm/timeout=240 -Xmx512m JPLinuxRpmPackageDepsTest
+ */
+public class JPLinuxRpmPackageDepsTest {
+ private static final String TEST_NAME = "JPLinuxRpmPackageDepsTest";
+ private static final String EXT = "rpm";
+
+ public static void main(String[] args) throws Exception {
+ JPLinuxPackageDepsBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPLinuxRpmTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPLinuxBase
+ * @requires (os.family == "linux")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPLinuxRpmTest
+ */
+public class JPLinuxRpmTest {
+ private static final String TEST_NAME = "JPLinuxRpmTest";
+ private static final String EXT = "rpm";
+
+ public static void main(String[] args) throws Exception {
+ JPLinuxBase.run(TEST_NAME, EXT);
+ }
+}
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPackageCreateInstallerBundleNameTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerBundleNameBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerBundleNameTest
- */
-public class JPackageCreateInstallerBundleNameTest {
- private static final String TEST_NAME = "JPackageCreateInstallerBundleNameTest";
- private static final String EXT = "rpm";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerBundleNameBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPackageCreateInstallerFileAssociationsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerFileAssociationsBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerFileAssociationsTest
- */
-public class JPackageCreateInstallerFileAssociationsTest {
- private static final String TEST_NAME = "JPackageCreateInstallerFileAssociationsTest";
- private static final String EXT = "rpm";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPackageCreateInstallerInstallDirTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerInstallDirBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerInstallDirTest
- */
-public class JPackageCreateInstallerInstallDirTest {
- private static final String TEST_NAME = "JPackageCreateInstallerInstallDirTest";
- private static final String EXT = "rpm";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerInstallDirBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPackageCreateInstallerLicenseTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerLicenseBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerLicenseTest
- */
-public class JPackageCreateInstallerLicenseTest {
- private static final String TEST_NAME = "JPackageCreateInstallerLicenseTest";
- private static final String EXT = "rpm";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerLicenseBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPackageCreateInstallerLicenseTypeTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerLicenseTypeBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerLicenseTypeTest
- */
-public class JPackageCreateInstallerLicenseTypeTest {
- private static final String TEST_NAME = "JPackageCreateInstallerLicenseTypeTest";
- private static final String EXT = "rpm";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerLicenseTypeBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPackageCreateInstallerPackageDepsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerPackageDepsBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @run main/othervm/timeout=240 -Xmx512m JPackageCreateInstallerPackageDepsTest
- */
-public class JPackageCreateInstallerPackageDepsTest {
- private static final String TEST_NAME = "JPackageCreateInstallerPackageDepsTest";
- private static final String EXT = "rpm";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerPackageDepsBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/JPackageCreateInstallerTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerBase
- * @requires (os.family == "linux")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerTest
- */
-public class JPackageCreateInstallerTest {
- private static final String TEST_NAME = "JPackageCreateInstallerTest";
- private static final String EXT = "rpm";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/install.sh Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/install.sh Thu Jun 27 17:44:18 2019 -0400
@@ -1,8 +1,8 @@
-sudo rpm --install jpackagecreateinstallerfileassociationstest-1.0-1.x86_64.rpm
-sudo rpm --install jpackagecreateinstallerinstalldirtest-1.0-1.x86_64.rpm
-sudo rpm --install jpackagecreateinstallerlicensetest-1.0-1.x86_64.rpm
-sudo rpm --install jpackagecreateinstallerlicensetypetest-1.0-1.x86_64.rpm
-sudo rpm --install jpackagecreateinstallerpackagedepstestdep-1.0-1.x86_64.rpm
-sudo rpm --install jpackagecreateinstallerpackagedepstest-1.0-1.x86_64.rpm
-sudo rpm --install jpackagecreateinstallertest-1.0-1.x86_64.rpm
+sudo rpm --install jplinuxrpmassociationstest-1.0-1.x86_64.rpm
+sudo rpm --install jplinuxrpminstalldirtest-1.0-1.x86_64.rpm
+sudo rpm --install jplinuxrpmlicensetest-1.0-1.x86_64.rpm
+sudo rpm --install jplinuxrpmlicensetypetest-1.0-1.x86_64.rpm
+sudo rpm --install jplinuxrpmpackagedepstestdep-1.0-1.x86_64.rpm
+sudo rpm --install jplinuxrpmpackagedepstest-1.0-1.x86_64.rpm
+sudo rpm --install jplinuxrpmtest-1.0-1.x86_64.rpm
sudo rpm --install jpackage-test-bundle-name-1.0-1.x86_64.rpm
--- a/test/jdk/tools/jpackage/createinstaller/linux/rpm/uninstall.sh Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/linux/rpm/uninstall.sh Thu Jun 27 17:44:18 2019 -0400
@@ -1,8 +1,8 @@
-sudo rpm -e jpackagecreateinstallerfileassociationstest
-sudo rpm -e jpackagecreateinstallerinstalldirtest
-sudo rpm -e jpackagecreateinstallerlicensetest
-sudo rpm -e jpackagecreateinstallerlicensetypetest
-sudo rpm -e jpackagecreateinstallerpackagedepstest
-sudo rpm -e jpackagecreateinstallerpackagedepstestdep
-sudo rpm -e jpackagecreateinstallertest
+sudo rpm -e jplinuxrpmassociationstest
+sudo rpm -e jplinuxrpminstalldirtest
+sudo rpm -e jplinuxrpmlicensetest
+sudo rpm -e jplinuxrpmlicensetypetest
+sudo rpm -e jplinuxrpmpackagedepstest
+sudo rpm -e jplinuxrpmpackagedepstestdep
+sudo rpm -e jplinuxrpmtest
sudo rpm -e jpackage-test-bundle-name
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/base/JPMacAssociationsBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Desktop;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPMacAssociationsBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String TEST_EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT);
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void validateAppOutput() throws Exception {
+ File outFile = new File("appOutput.txt");
+ int count = 10;
+ boolean bOutputCreated = false;
+ while (count > 0) {
+ if (!outFile.exists()) {
+ Thread.sleep(3000);
+ count--;
+ } else {
+ bOutputCreated = true;
+ break;
+ }
+ }
+
+ if (!bOutputCreated) {
+ throw new AssertionError(outFile.getAbsolutePath() + " was not created");
+ }
+
+ String output = Files.readString(outFile.toPath());
+ String[] result = output.split("\n");
+ if (result.length != 3) {
+ System.err.println(output);
+ throw new AssertionError(
+ "Unexpected number of lines: " + result.length);
+ }
+
+ if (!result[0].trim().equals("jpackage test application")) {
+ throw new AssertionError("Unexpected result[0]: " + result[0]);
+ }
+
+ if (!result[1].trim().equals("args.length: 1")) {
+ throw new AssertionError("Unexpected result[1]: " + result[1]);
+ }
+
+ File faFile = new File(TEST_NAME + "." + TEST_EXT);
+ if (!result[2].trim().equals(faFile.getAbsolutePath())) {
+ throw new AssertionError("Unexpected result[2]: " + result[2]);
+ }
+ }
+
+ private static void verifyInstall() throws Exception {
+ createAssociationsTestFile();
+ Desktop.getDesktop().open(new File(TEST_NAME + "." + TEST_EXT));
+ validateAppOutput();
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ // Not needed on OS X, since we just deleting installed application
+ // without using generated installer. We keeping this for consistnency
+ // between platforms.
+ }
+
+ private static void createAssociationsTestFile() throws Exception {
+ try (PrintWriter out = new PrintWriter(new BufferedWriter(
+ new FileWriter(TEST_NAME + "." + TEST_EXT)))) {
+ out.println(TEST_NAME);
+ }
+ }
+
+ private static void createAssociationsProperties() throws Exception {
+ try (PrintWriter out = new PrintWriter(new BufferedWriter(
+ new FileWriter("fa.properties")))) {
+ out.println("extension=" + TEST_EXT);
+ out.println("mime-type=application/" + TEST_EXT);
+ out.println("description=jpackage test extention");
+ }
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ TEST_EXT = "jptest1";
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--file-associations", "fa.properties"};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ createAssociationsProperties();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/base/JPMacBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPMacBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT);
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getOSXInstalledApp(TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ // Not needed on OS X, since we just deleting installed application
+ // without using generated installer. We keeping this for consistnency
+ // between platforms.
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello"};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/base/JPMacInstallDirBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPMacInstallDirBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT);
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getOSXInstalledApp("jpackage", TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ // Not needed on OS X, since we just deleting installed application
+ // without using generated installer. We keeping this for consistnency
+ // between platforms.
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ CMD = new String[]{
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--install-dir", "/Applications/jpackage"};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/base/JPMacLicenseBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JPMacLicenseBase {
+
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void copyResults() throws Exception {
+ List<String> files = new ArrayList<>();
+ files.add(OUTPUT);
+ JPackageInstallerHelper.copyTestResults(files);
+ }
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+ JPackageInstallerHelper.validateOutput(OUTPUT);
+ copyResults();
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getOSXInstalledApp(TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ // Not needed on OS X, since we just deleting installed application
+ // without using generated installer. We keeping this for consistnency
+ // between platforms.
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ CMD = new String [] {
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--license-file", JPackagePath.getLicenseFilePath()};
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/base/JPMacOptionsBase.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+
+public class JPMacOptionsBase {
+
+ static final String TEST_BUNDLE_NAME = "TestBundleName";
+ static final String TEST_BUNDLE_IDENTIFIER = "net.java.openjdk.packagerTest";
+ static final String TEST_CATECORY = "public.app-category.test";
+ private static String TEST_NAME;
+ private static String EXT;
+ private static String OUTPUT;
+ private static String[] CMD;
+
+ private static void testCreateInstaller() throws Exception {
+ JPackageHelper.executeCLI(true, CMD);
+
+ if (EXT.equals("dmg")) {
+ String disk = null;
+ try {
+ var log = new File("hdiutil.log");
+ JPackageHelper.execute(log, "/usr/bin/hdiutil",
+ "attach", OUTPUT);
+ try(var br = new BufferedReader(new FileReader(log))) {
+ var line = br.lines().reduce((a, b) -> b).orElse(null)
+ .split("\t");
+ disk = line[0].trim();
+ testPkg(line[2].trim() + File.separator + TEST_NAME +
+ "-1.0.pkg");
+ }
+ } finally {
+ if (disk != null) {
+ JPackageHelper.execute(null,
+ "/usr/bin/hdiutil", "detach", disk);
+ }
+ }
+ } else {
+ testPkg(OUTPUT);
+ }
+ }
+
+ private static void testPkg(String path) throws Exception {
+ JPackageHelper.execute(null, "/usr/sbin/pkgutil",
+ "--expand-full", path, "expand");
+ var info = new File("expand/" + TEST_NAME + "-app.pkg/Payload/"
+ + TEST_NAME + ".app/Contents/Info.plist");
+ if (!info.exists()) {
+ throw new AssertionError("Info.plist not found");
+ }
+
+ String bundleName = null;
+ String bundleIdentifier = null;
+ String categoryType = null;
+ try (FileInputStream fis = new FileInputStream(info)) {
+ var xmlInFact = XMLInputFactory.newInstance();
+ xmlInFact.setProperty(XMLInputFactory.SUPPORT_DTD, false);
+ xmlInFact.setProperty(
+ XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
+ var reader = xmlInFact.createXMLStreamReader(fis);
+ while (reader.hasNext()) {
+ if (reader.next() == XMLStreamConstants.CHARACTERS) {
+ switch (reader.getText()) {
+ case "CFBundleName": {
+ bundleName = readValue(reader);
+ break;
+ }
+ case "CFBundleIdentifier" : {
+ bundleIdentifier = readValue(reader);
+ break;
+ }
+ case "LSApplicationCategoryType" : {
+ categoryType = readValue(reader);
+ break;
+ }
+ }
+ }
+ }
+ }
+ boolean passed = true;
+ if (!TEST_BUNDLE_NAME.equals(bundleName)) {
+ passed = false;
+ System.err.println("Wrong bundle name [" + bundleName +
+ "] expected [" + TEST_BUNDLE_NAME + "]" );
+ }
+ if (!TEST_BUNDLE_IDENTIFIER.equals(bundleIdentifier)) {
+ passed = false;
+ System.err.println("Wrong bundle identifier [" +
+ bundleIdentifier + "] expected [" + TEST_BUNDLE_IDENTIFIER
+ + "]" );
+ }
+ if (!TEST_CATECORY.equals(categoryType)) {
+ passed = false;
+ System.err.println("Wrong appstore category [" + categoryType +
+ "] expected [" + TEST_CATECORY + "]" );
+ }
+
+ if (!passed) {
+ throw new AssertionError("Test failed");
+ }
+ }
+
+ static private String readValue(XMLStreamReader reader) throws Exception {
+ while (reader.hasNext() && reader.next() != XMLStreamConstants.START_ELEMENT);
+ return reader.hasNext() ? reader.getElementText() : null;
+ }
+
+ private static void verifyInstall() throws Exception {
+ String app = JPackagePath.getOSXInstalledApp("jpackage", TEST_NAME);
+ JPackageInstallerHelper.validateApp(app);
+ }
+
+ private static void verifyUnInstall() throws Exception {
+ // Not needed on OS X, since we just deleting installed application
+ // without using generated installer. We keeping this for consistnency
+ // between platforms.
+ }
+
+ private static void init(String name, String ext) {
+ TEST_NAME = name;
+ EXT = ext;
+ OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
+ CMD = new String[] {
+ "--package-type", EXT,
+ "--input", "input",
+ "--output", "output",
+ "--name", TEST_NAME,
+ "--main-jar", "hello.jar",
+ "--main-class", "Hello",
+ "--mac-bundle-name", TEST_BUNDLE_NAME,
+ "--mac-bundle-identifier", TEST_BUNDLE_IDENTIFIER,
+ "--mac-app-store-category", TEST_CATECORY
+ };
+ }
+
+ public static void run(String name, String ext) throws Exception {
+ init(name, ext);
+
+ if (JPackageInstallerHelper.isVerifyInstall()) {
+ verifyInstall();
+ } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
+ verifyUnInstall();
+ } else {
+ JPackageHelper.createHelloInstallerJar();
+ testCreateInstaller();
+ }
+ }
+}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/base/JPackageCreateInstallerBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT);
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getOSXInstalledApp(TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- // Not needed on OS X, since we just deleting installed application
- // without using generated installer. We keeping this for consistnency
- // between platforms.
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello"};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/base/JPackageCreateInstallerFileAssociationsBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.Desktop;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerFileAssociationsBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String TEST_EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT);
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void validateAppOutput() throws Exception {
- File outFile = new File("appOutput.txt");
- int count = 10;
- boolean bOutputCreated = false;
- while (count > 0) {
- if (!outFile.exists()) {
- Thread.sleep(3000);
- count--;
- } else {
- bOutputCreated = true;
- break;
- }
- }
-
- if (!bOutputCreated) {
- throw new AssertionError(outFile.getAbsolutePath() + " was not created");
- }
-
- String output = Files.readString(outFile.toPath());
- String[] result = output.split("\n");
- if (result.length != 3) {
- System.err.println(output);
- throw new AssertionError(
- "Unexpected number of lines: " + result.length);
- }
-
- if (!result[0].trim().equals("jpackage test application")) {
- throw new AssertionError("Unexpected result[0]: " + result[0]);
- }
-
- if (!result[1].trim().equals("args.length: 1")) {
- throw new AssertionError("Unexpected result[1]: " + result[1]);
- }
-
- File faFile = new File(TEST_NAME + "." + TEST_EXT);
- if (!result[2].trim().equals(faFile.getAbsolutePath())) {
- throw new AssertionError("Unexpected result[2]: " + result[2]);
- }
- }
-
- private static void verifyInstall() throws Exception {
- createFileAssociationsTestFile();
- Desktop.getDesktop().open(new File(TEST_NAME + "." + TEST_EXT));
- validateAppOutput();
- }
-
- private static void verifyUnInstall() throws Exception {
- // Not needed on OS X, since we just deleting installed application
- // without using generated installer. We keeping this for consistnency
- // between platforms.
- }
-
- private static void createFileAssociationsTestFile() throws Exception {
- try (PrintWriter out = new PrintWriter(new BufferedWriter(
- new FileWriter(TEST_NAME + "." + TEST_EXT)))) {
- out.println(TEST_NAME);
- }
- }
-
- private static void createFileAssociationsProperties() throws Exception {
- try (PrintWriter out = new PrintWriter(new BufferedWriter(
- new FileWriter("fa.properties")))) {
- out.println("extension=" + TEST_EXT);
- out.println("mime-type=application/" + TEST_EXT);
- out.println("description=jpackage test extention");
- }
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- TEST_EXT = "jptest1";
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--file-associations", "fa.properties"};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- createFileAssociationsProperties();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/base/JPackageCreateInstallerInstallDirBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerInstallDirBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT);
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getOSXInstalledApp("jpackage", TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- // Not needed on OS X, since we just deleting installed application
- // without using generated installer. We keeping this for consistnency
- // between platforms.
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- CMD = new String[]{
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--install-dir", "/Applications/jpackage"};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/base/JPackageCreateInstallerLicenseBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class JPackageCreateInstallerLicenseBase {
-
- private static String TEST_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void copyResults() throws Exception {
- List<String> files = new ArrayList<>();
- files.add(OUTPUT);
- JPackageInstallerHelper.copyTestResults(files);
- }
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
- JPackageInstallerHelper.validateOutput(OUTPUT);
- copyResults();
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getOSXInstalledApp(TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
-
- }
-
- private static void verifyUnInstall() throws Exception {
- // Not needed on OS X, since we just deleting installed application
- // without using generated installer. We keeping this for consistnency
- // between platforms.
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- CMD = new String [] {
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--license-file", JPackagePath.getLicenseFilePath()};
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/base/JPackageCreateInstallerMacOptionsBase.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-
-public class JPackageCreateInstallerMacOptionsBase {
-
- static final String TEST_BUNDLE_NAME = "TestBundleName";
- static final String TEST_BUNDLE_IDENTIFIER = "net.java.openjdk.packagerTest";
- static final String TEST_CATECORY = "public.app-category.test";
- private static String TEST_NAME;
- private static String EXT;
- private static String OUTPUT;
- private static String[] CMD;
-
- private static void testCreateInstaller() throws Exception {
- JPackageHelper.executeCLI(true, CMD);
-
- if (EXT.equals("dmg")) {
- String disk = null;
- try {
- var log = new File("hdiutil.log");
- JPackageHelper.execute(log, "/usr/bin/hdiutil",
- "attach", OUTPUT);
- try(var br = new BufferedReader(new FileReader(log))) {
- var line = br.lines().reduce((a, b) -> b).orElse(null)
- .split("\t");
- disk = line[0].trim();
- testPkg(line[2].trim() + File.separator + TEST_NAME +
- "-1.0.pkg");
- }
- } finally {
- if (disk != null) {
- JPackageHelper.execute(null,
- "/usr/bin/hdiutil", "detach", disk);
- }
- }
- } else {
- testPkg(OUTPUT);
- }
- }
-
- private static void testPkg(String path) throws Exception {
- JPackageHelper.execute(null, "/usr/sbin/pkgutil",
- "--expand-full", path, "expand");
- var info = new File("expand/" + TEST_NAME + "-app.pkg/Payload/"
- + TEST_NAME + ".app/Contents/Info.plist");
- if (!info.exists()) {
- throw new AssertionError("Info.plist not found");
- }
-
- String bundleName = null;
- String bundleIdentifier = null;
- String categoryType = null;
- try (FileInputStream fis = new FileInputStream(info)) {
- var xmlInFact = XMLInputFactory.newInstance();
- xmlInFact.setProperty(XMLInputFactory.SUPPORT_DTD, false);
- xmlInFact.setProperty(
- XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
- var reader = xmlInFact.createXMLStreamReader(fis);
- while (reader.hasNext()) {
- if (reader.next() == XMLStreamConstants.CHARACTERS) {
- switch (reader.getText()) {
- case "CFBundleName": {
- bundleName = readValue(reader);
- break;
- }
- case "CFBundleIdentifier" : {
- bundleIdentifier = readValue(reader);
- break;
- }
- case "LSApplicationCategoryType" : {
- categoryType = readValue(reader);
- break;
- }
- }
- }
- }
- }
- boolean passed = true;
- if (!TEST_BUNDLE_NAME.equals(bundleName)) {
- passed = false;
- System.err.println("Wrong bundle name [" + bundleName +
- "] expected [" + TEST_BUNDLE_NAME + "]" );
- }
- if (!TEST_BUNDLE_IDENTIFIER.equals(bundleIdentifier)) {
- passed = false;
- System.err.println("Wrong bundle identifier [" +
- bundleIdentifier + "] expected [" + TEST_BUNDLE_IDENTIFIER
- + "]" );
- }
- if (!TEST_CATECORY.equals(categoryType)) {
- passed = false;
- System.err.println("Wrong appstore category [" + categoryType +
- "] expected [" + TEST_CATECORY + "]" );
- }
-
- if (!passed) {
- throw new AssertionError("Test failed");
- }
- }
-
- static private String readValue(XMLStreamReader reader) throws Exception {
- while (reader.hasNext() && reader.next() != XMLStreamConstants.START_ELEMENT);
- return reader.hasNext() ? reader.getElementText() : null;
- }
-
- private static void verifyInstall() throws Exception {
- String app = JPackagePath.getOSXInstalledApp("jpackage", TEST_NAME);
- JPackageInstallerHelper.validateApp(app);
- }
-
- private static void verifyUnInstall() throws Exception {
- // Not needed on OS X, since we just deleting installed application
- // without using generated installer. We keeping this for consistnency
- // between platforms.
- }
-
- private static void init(String name, String ext) {
- TEST_NAME = name;
- EXT = ext;
- OUTPUT = "output" + File.separator + TEST_NAME + "-1.0." + EXT;
- CMD = new String[] {
- "--package-type", EXT,
- "--input", "input",
- "--output", "output",
- "--name", TEST_NAME,
- "--main-jar", "hello.jar",
- "--main-class", "Hello",
- "--mac-bundle-name", TEST_BUNDLE_NAME,
- "--mac-bundle-identifier", TEST_BUNDLE_IDENTIFIER,
- "--mac-app-store-category", TEST_CATECORY
- };
- }
-
- public static void run(String name, String ext) throws Exception {
- init(name, ext);
-
- if (JPackageInstallerHelper.isVerifyInstall()) {
- verifyInstall();
- } else if (JPackageInstallerHelper.isVerifyUnInstall()) {
- verifyUnInstall();
- } else {
- JPackageHelper.createHelloInstallerJar();
- testCreateInstaller();
- }
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPMacDmgAssociationsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacAssociationsBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPMacDmgAssociationsTest
+ */
+public class JPMacDmgAssociationsTest {
+ private static final String TEST_NAME = "JPMacDmgAssociationsTest";
+ private static final String EXT = "dmg";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.MacDmgBundler.isSupported()) {
+ JPMacAssociationsBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPMacDmgInstallDirTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacInstallDirBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPMacDmgInstallDirTest
+ */
+public class JPMacDmgInstallDirTest {
+ private static final String TEST_NAME = "JPMacDmgInstallDirTest";
+ private static final String EXT = "dmg";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.MacDmgBundler.isSupported()) {
+ JPMacInstallDirBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPMacDmgLicenseTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacLicenseBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPMacDmgLicenseTest
+ */
+public class JPMacDmgLicenseTest {
+ private static final String TEST_NAME = "JPMacDmgLicenseTest";
+ private static final String EXT = "dmg";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.MacDmgBundler.isSupported()) {
+ JPMacLicenseBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPMacDmgOptionsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacOptionsBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPMacDmgOptionsTest
+ */
+public class JPMacDmgOptionsTest {
+ private static final String TEST_NAME = "JPMacDmgOptionsTest";
+ private static final String EXT = "dmg";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.MacDmgBundler.isSupported()) {
+ JPMacOptionsBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPMacDmgTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @run main/othervm -Xmx512m JPMacDmgTest
+ */
+public class JPMacDmgTest {
+ private static final String TEST_NAME = "JPMacDmgTest";
+ private static final String EXT = "dmg";
+
+ public static void main(String[] args) throws Exception {
+ if (jdk.jpackage.internal.MacDmgBundler.isSupported()) {
+ JPMacBase.run(TEST_NAME, EXT);
+ }
+ }
+}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPackageCreateInstallerFileAssociationsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerFileAssociationsBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerFileAssociationsTest
- */
-public class JPackageCreateInstallerFileAssociationsTest {
- private static final String TEST_NAME = "JPackageCreateInstallerFileAssociationsTest";
- private static final String EXT = "dmg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPackageCreateInstallerInstallDirTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerInstallDirBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerInstallDirTest
- */
-public class JPackageCreateInstallerInstallDirTest {
- private static final String TEST_NAME = "JPackageCreateInstallerInstallDirTest";
- private static final String EXT = "dmg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerInstallDirBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPackageCreateInstallerLicenseTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerLicenseBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerLicenseTest
- */
-public class JPackageCreateInstallerLicenseTest {
- private static final String TEST_NAME = "JPackageCreateInstallerLicenseTest";
- private static final String EXT = "dmg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerLicenseBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPackageCreateInstallerMacOptionsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerMacOptionsBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerMacOptionsTest
- */
-public class JPackageCreateInstallerMacOptionsTest {
- private static final String TEST_NAME = "JPackageCreateInstallerMacOptionsTest";
- private static final String EXT = "dmg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerMacOptionsBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/dmg/JPackageCreateInstallerTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @ignore
- * @run main/othervm -Xmx512m JPackageCreateInstallerTest
- */
-public class JPackageCreateInstallerTest {
- private static final String TEST_NAME = "JPackageCreateInstallerTest";
- private static final String EXT = "dmg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/dmg/install.sh Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/dmg/install.sh Thu Jun 27 17:44:18 2019 -0400
@@ -1,21 +1,26 @@
echo "Note: This script will install DMG files silently. In order to verify UI, each .dmg needs to launched manually via Finder."
-# JPackageCreateInstallerTest
-hdiutil attach JPackageCreateInstallerTest-1.0.dmg
-sudo /usr/sbin/installer -pkg /Volumes/JPackageCreateInstallerTest/JPackageCreateInstallerTest-1.0.pkg -target /
-hdiutil detach /Volumes/JPackageCreateInstallerTest/
+# JPMacDmgTest
+hdiutil attach JPMacDmgTest-1.0.dmg
+sudo /usr/sbin/installer -pkg /Volumes/JPMacDmgTest/JPMacDmgTest-1.0.pkg -target /
+hdiutil detach /Volumes/JPMacDmgTest/
-# JPackageCreateInstallerLicenseTest
-hdiutil attach JPackageCreateInstallerLicenseTest-1.0.dmg
-sudo /usr/sbin/installer -pkg /Volumes/JPackageCreateInstallerLicenseTest/JPackageCreateInstallerLicenseTest-1.0.pkg -target /
-hdiutil detach /Volumes/JPackageCreateInstallerLicenseTest/
+# JPMacDmgLicenseTest
+hdiutil attach JPMacDmgLicenseTest-1.0.dmg
+sudo /usr/sbin/installer -pkg /Volumes/JPMacDmgLicenseTest/JPMacDmgLicenseTest-1.0.pkg -target /
+hdiutil detach /Volumes/JPMacDmgLicenseTest/
-# JPackageCreateInstallerFileAssociationsTest
-hdiutil attach JPackageCreateInstallerFileAssociationsTest-1.0.dmg
-sudo /usr/sbin/installer -pkg /Volumes/JPackageCreateInstallerFileAssociationsTest/JPackageCreateInstallerFileAssociationsTest-1.0.pkg -target /
-hdiutil detach /Volumes/JPackageCreateInstallerFileAssociationsTest/
+# JPMacDmgAssociationsTest
+hdiutil attach JPMacDmgAssociationsTest-1.0.dmg
+sudo /usr/sbin/installer -pkg /Volumes/JPMacDmgAssociationsTest/JPMacDmgAssociationsTest-1.0.pkg -target /
+hdiutil detach /Volumes/JPMacDmgAssociationsTest/
-# JPackageCreateInstallerInstallDirTest
-hdiutil attach JPackageCreateInstallerInstallDirTest-1.0.dmg
-sudo /usr/sbin/installer -pkg /Volumes/JPackageCreateInstallerInstallDirTest/JPackageCreateInstallerInstallDirTest-1.0.pkg -target /
-hdiutil detach /Volumes/JPackageCreateInstallerInstallDirTest/
+# JPMacDmgOptionsTest
+hdiutil attach JPMacDmgOptionsTest-1.0.dmg
+sudo /usr/sbin/installer -pkg /Volumes/JPMacDmgOptionsTest/JPMacDmgOptionsTest-1.0.pkg -target /
+hdiutil detach /Volumes/JPMacDmgOptionsTest/
+
+# JPMacDmgInstallDirTest
+hdiutil attach JPMacDmgInstallDirTest-1.0.dmg
+sudo /usr/sbin/installer -pkg /Volumes/JPMacDmgInstallDirTest/JPMacDmgInstallDirTest-1.0.pkg -target /
+hdiutil detach /Volumes/JPMacDmgInstallDirTest/
--- a/test/jdk/tools/jpackage/createinstaller/macosx/dmg/uninstall.sh Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/dmg/uninstall.sh Thu Jun 27 17:44:18 2019 -0400
@@ -1,4 +1,5 @@
-sudo rm -rf /Applications/JPackageCreateInstallerTest.app
-sudo rm -rf /Applications/JPackageCreateInstallerLicenseTest.app
-sudo rm -rf /Applications/JPackageCreateInstallerFileAssociationsTest.app
-sudo rm -rf /Applications/jpackage/JPackageCreateInstallerInstallDirTest.app
+sudo rm -rf /Applications/JPMacDmgTest.app
+sudo rm -rf /Applications/JPMacDmgLicenseTest.app
+sudo rm -rf /Applications/JPMacDmgAssociationsTest.app
+sudo rm -rf /Applications/JPMacDmgOptionsTest.app
+sudo rm -rf /Applications/jpackage/JPMacDmgInstallDirTest.app
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPMacPkgAssociationsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacAssociationsBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPMacPkgAssociationsTest
+ */
+public class JPMacPkgAssociationsTest {
+ private static final String TEST_NAME = "JPMacPkgAssociationsTest";
+ private static final String EXT = "pkg";
+
+ public static void main(String[] args) throws Exception {
+ JPMacAssociationsBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPMacPkgInstallDirTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacInstallDirBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPMacPkgInstallDirTest
+ */
+public class JPMacPkgInstallDirTest {
+ private static final String TEST_NAME = "JPMacPkgInstallDirTest";
+ private static final String EXT = "pkg";
+
+ public static void main(String[] args) throws Exception {
+ JPMacInstallDirBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPMacPkgLicenseTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacLicenseBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPMacPkgLicenseTest
+ */
+public class JPMacPkgLicenseTest {
+ private static final String TEST_NAME = "JPMacPkgLicenseTest";
+ private static final String EXT = "pkg";
+
+ public static void main(String[] args) throws Exception {
+ JPMacLicenseBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPMacPkgOptionsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacOptionsBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPMacPkgOptionsTest
+ */
+public class JPMacPkgOptionsTest {
+ private static final String TEST_NAME = "JPMacPkgOptionsTest";
+ private static final String EXT = "pkg";
+
+ public static void main(String[] args) throws Exception {
+ JPMacOptionsBase.run(TEST_NAME, EXT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPMacPkgTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, 2019, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary jpackage create installer test
+ * @library ../../../helpers
+ * @library ../base
+ * @build JPackageHelper
+ * @build JPackagePath
+ * @build JPackageInstallerHelper
+ * @build JPMacBase
+ * @requires (os.family == "mac")
+ * @modules jdk.jpackage
+ * @run main/othervm -Xmx512m JPMacPkgTest
+ */
+public class JPMacPkgTest {
+ private static final String TEST_NAME = "JPMacPkgTest";
+ private static final String EXT = "pkg";
+
+ public static void main(String[] args) throws Exception {
+ JPMacBase.run(TEST_NAME, EXT);
+ }
+}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPackageCreateInstallerFileAssociationsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerFileAssociationsBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerFileAssociationsTest
- */
-public class JPackageCreateInstallerFileAssociationsTest {
- private static final String TEST_NAME = "JPackageCreateInstallerFileAssociationsTest";
- private static final String EXT = "pkg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPackageCreateInstallerInstallDirTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerInstallDirBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerInstallDirTest
- */
-public class JPackageCreateInstallerInstallDirTest {
- private static final String TEST_NAME = "JPackageCreateInstallerInstallDirTest";
- private static final String EXT = "pkg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerInstallDirBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPackageCreateInstallerLicenseTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerLicenseBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerLicenseTest
- */
-public class JPackageCreateInstallerLicenseTest {
- private static final String TEST_NAME = "JPackageCreateInstallerLicenseTest";
- private static final String EXT = "pkg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerLicenseBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPackageCreateInstallerMacOptionsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerMacOptionsBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerMacOptionsTest
- */
-public class JPackageCreateInstallerMacOptionsTest {
- private static final String TEST_NAME = "JPackageCreateInstallerMacOptionsTest";
- private static final String EXT = "pkg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerMacOptionsBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/pkg/JPackageCreateInstallerTest.java Fri Jun 21 10:14:49 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018, 2019, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary jpackage create installer test
- * @library ../../../helpers
- * @library ../base
- * @build JPackageHelper
- * @build JPackagePath
- * @build JPackageInstallerHelper
- * @build JPackageCreateInstallerBase
- * @requires (os.family == "mac")
- * @modules jdk.jpackage
- * @run main/othervm -Xmx512m JPackageCreateInstallerTest
- */
-public class JPackageCreateInstallerTest {
- private static final String TEST_NAME = "JPackageCreateInstallerTest";
- private static final String EXT = "pkg";
-
- public static void main(String[] args) throws Exception {
- JPackageCreateInstallerBase.run(TEST_NAME, EXT);
- }
-}
--- a/test/jdk/tools/jpackage/createinstaller/macosx/pkg/install.sh Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/pkg/install.sh Thu Jun 27 17:44:18 2019 -0400
@@ -1,5 +1,6 @@
echo Note: This script will install packages silently. In order to verify UI, each .pkg needs to launched manually via Finder.
-sudo /usr/sbin/installer -pkg JPackageCreateInstallerTest-1.0.pkg -target /
-sudo /usr/sbin/installer -pkg JPackageCreateInstallerLicenseTest-1.0.pkg -target /
-sudo /usr/sbin/installer -pkg JPackageCreateInstallerFileAssociationsTest-1.0.pkg -target /
-sudo /usr/sbin/installer -pkg JPackageCreateInstallerInstallDirTest-1.0.pkg -target /
+sudo /usr/sbin/installer -pkg JPMacPkgTest-1.0.pkg -target /
+sudo /usr/sbin/installer -pkg JPMacPkgLicenseTest-1.0.pkg -target /
+sudo /usr/sbin/installer -pkg JPMacPkgAssociationsTest-1.0.pkg -target /
+sudo /usr/sbin/installer -pkg JPMacOptionsTest-1.0.pkg -target /
+sudo /usr/sbin/installer -pkg JPMacPkgInstallDirTest-1.0.pkg -target /
--- a/test/jdk/tools/jpackage/createinstaller/macosx/pkg/uninstall.sh Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/macosx/pkg/uninstall.sh Thu Jun 27 17:44:18 2019 -0400
@@ -1,4 +1,5 @@
-sudo rm -rf /Applications/JPackageCreateInstallerTest.app
-sudo rm -rf /Applications/JPackageCreateInstallerLicenseTest.app
-sudo rm -rf /Applications/JPackageCreateInstallerFileAssociationsTest.app
-sudo rm -rf /Applications/jpackage/JPackageCreateInstallerInstallDirTest.app
+sudo rm -rf /Applications/JPMacPkgTest.app
+sudo rm -rf /Applications/JPMacPkgLicenseTest.app
+sudo rm -rf /Applications/JPMacPkgAssociationsTest.app
+sudo rm -rf /Applications/JPMacPkgOptionsDirTest.app
+sudo rm -rf /Applications/jpackage/JPMacPkgInstallDirTest.app
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerFileAssociationsInstallDirTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerFileAssociationsInstallDirTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerFileAssociationsBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerFileAssociationsInstallDirTest
*/
public class JPackageCreateInstallerFileAssociationsInstallDirTest {
@@ -43,6 +43,8 @@
private static final String TEST_EXT = "jptest3";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT, INSTALL_DIR, TEST_EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT, INSTALL_DIR, TEST_EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerFileAssociationsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerFileAssociationsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerFileAssociationsBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerFileAssociationsTest
*/
public class JPackageCreateInstallerFileAssociationsTest {
@@ -41,6 +41,8 @@
private static final String TEST_EXT = "jptest1";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT, null, TEST_EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT, null, TEST_EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerInstallDirTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerInstallDirTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerInstallDirBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerInstallDirTest
*/
public class JPackageCreateInstallerInstallDirTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerInstallDirBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerInstallDirBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerLicenseTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerLicenseTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerLicenseBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerLicenseTest
*/
public class JPackageCreateInstallerLicenseTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerLicenseBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerLicenseBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerRuntimeTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerRuntimeTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -34,7 +34,7 @@
* @build JPackageCreateInstallerRuntimeBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerRuntimeTest
*/
public class JPackageCreateInstallerRuntimeTest {
@@ -43,6 +43,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerRuntimeBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerRuntimeBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerTest
*/
public class JPackageCreateInstallerTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinDirChooserTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinDirChooserTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinDirChooserBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinDirChooserTest
*/
public class JPackageCreateInstallerWinDirChooserTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinDirChooserBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinDirChooserBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinMenuGroupTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinMenuGroupTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinMenuGroupBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinMenuGroupTest
*/
public class JPackageCreateInstallerWinMenuGroupTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinMenuGroupBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinMenuGroupBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinMenuTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinMenuTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinMenuBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinMenuTest
*/
public class JPackageCreateInstallerWinMenuTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinMenuBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinMenuBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinPerUserInstallTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinPerUserInstallTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinPerUserInstallBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinPerUserInstallTest
*/
public class JPackageCreateInstallerWinPerUserInstallTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinPerUserInstallBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinPerUserInstallBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinRegistryNameTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinRegistryNameTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinRegistryNameBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinRegistryNameTest
*/
public class JPackageCreateInstallerWinRegistryNameTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinRegistryNameBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinRegistryNameBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinShortcutTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinShortcutTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinShortcutBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinShortcutTest
*/
public class JPackageCreateInstallerWinShortcutTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinShortcutBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinShortcutBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinUpgradeUUIDTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/exe/JPackageCreateInstallerWinUpgradeUUIDTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinUpgradeUUIDBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinUpgradeUUIDTest
*/
public class JPackageCreateInstallerWinUpgradeUUIDTest {
@@ -40,6 +40,8 @@
private static final String EXT = "exe";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinUpgradeUUIDBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinUpgradeUUIDBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerFileAssociationsInstallDirTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerFileAssociationsInstallDirTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerFileAssociationsBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerFileAssociationsInstallDirTest
*/
public class JPackageCreateInstallerFileAssociationsInstallDirTest {
@@ -43,6 +43,9 @@
private static final String TEST_EXT = "jptest3";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT, INSTALL_DIR, TEST_EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME,
+ EXT, INSTALL_DIR, TEST_EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerFileAssociationsTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerFileAssociationsTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerFileAssociationsBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerFileAssociationsTest
*/
public class JPackageCreateInstallerFileAssociationsTest {
@@ -41,6 +41,9 @@
private static final String TEST_EXT = "jptest1";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME, EXT, null, TEST_EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerFileAssociationsBase.run(TEST_NAME,
+ EXT, null, TEST_EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerInstallDirTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerInstallDirTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerInstallDirBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerInstallDirTest
*/
public class JPackageCreateInstallerInstallDirTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerInstallDirBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerInstallDirBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerLicenseTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerLicenseTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerLicenseBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerLicenseTest
*/
public class JPackageCreateInstallerLicenseTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerLicenseBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerLicenseBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerRuntimeTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerRuntimeTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -34,7 +34,7 @@
* @build JPackageCreateInstallerRuntimeBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerRuntimeTest
*/
public class JPackageCreateInstallerRuntimeTest {
@@ -43,6 +43,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerRuntimeBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerRuntimeBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerTest
*/
public class JPackageCreateInstallerTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinDirChooserTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinDirChooserTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinDirChooserBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinDirChooserTest
*/
public class JPackageCreateInstallerWinDirChooserTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinDirChooserBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinDirChooserBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinMenuGroupTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinMenuGroupTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinMenuGroupBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinMenuGroupTest
*/
public class JPackageCreateInstallerWinMenuGroupTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinMenuGroupBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinMenuGroupBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinMenuTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinMenuTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinMenuBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinMenuTest
*/
public class JPackageCreateInstallerWinMenuTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinMenuBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinMenuBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinPerUserInstallTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinPerUserInstallTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinPerUserInstallBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinPerUserInstallTest
*/
public class JPackageCreateInstallerWinPerUserInstallTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinPerUserInstallBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinPerUserInstallBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinRegistryNameTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinRegistryNameTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinRegistryNameBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinRegistryNameTest
*/
public class JPackageCreateInstallerWinRegistryNameTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinRegistryNameBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinRegistryNameBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinShortcutTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinShortcutTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinShortcutBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinShortcutTest
*/
public class JPackageCreateInstallerWinShortcutTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinShortcutBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinShortcutBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinUpgradeUUIDTest.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/createinstaller/windows/msi/JPackageCreateInstallerWinUpgradeUUIDTest.java Thu Jun 27 17:44:18 2019 -0400
@@ -32,7 +32,7 @@
* @build JPackageCreateInstallerWinUpgradeUUIDBase
* @requires (os.family == "windows")
* @modules jdk.jpackage
- * @ignore
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm -Xmx512m JPackageCreateInstallerWinUpgradeUUIDTest
*/
public class JPackageCreateInstallerWinUpgradeUUIDTest {
@@ -40,6 +40,8 @@
private static final String EXT = "msi";
public static void main(String[] args) throws Exception {
- JPackageCreateInstallerWinUpgradeUUIDBase.run(TEST_NAME, EXT);
+ if (jdk.jpackage.internal.WinMsiBundler.isSupported()) {
+ JPackageCreateInstallerWinUpgradeUUIDBase.run(TEST_NAME, EXT);
+ }
}
}
--- a/test/jdk/tools/jpackage/helpers/JPackageHelper.java Fri Jun 21 10:14:49 2019 -0400
+++ b/test/jdk/tools/jpackage/helpers/JPackageHelper.java Thu Jun 27 17:44:18 2019 -0400
@@ -65,30 +65,32 @@
}
// Figure out test src based on where we called
- File testSrc = new File(System.getProperty("test.src") + File.separator + ".."
- + File.separator + "apps");
- if (testSrc.exists()) {
- TEST_SRC_ROOT = System.getProperty("test.src") + File.separator + "..";
+ TEST_SRC = System.getProperty("test.src");
+ Path root = Path.of(TEST_SRC);
+ Path apps = Path.of(TEST_SRC, "apps");
+ if (apps.toFile().exists()) {
+ // fine - test is at root
} else {
- testSrc = new File(System.getProperty("test.src") + File.separator
- + ".." + File.separator + ".." + File.separator + "apps");
- if (testSrc.exists()) {
- TEST_SRC_ROOT = System.getProperty("test.src") + File.separator + ".."
- + File.separator + "..";
- } else {
- testSrc = new File(System.getProperty("test.src") + File.separator
- + ".." + File.separator + ".." + File.separator + ".."
- + File.separator + "apps");
- if (testSrc.exists()) {
- TEST_SRC_ROOT = System.getProperty("test.src") + File.separator + ".."
- + File.separator + ".." + File.separator + "..";
- } else {
- TEST_SRC_ROOT = System.getProperty("test.src");
- }
+ apps = Path.of(TEST_SRC, "..", "apps");
+ if (apps.toFile().exists()) {
+ root = apps.getParent().normalize(); // test is 1 level down
+ } else {
+ apps = Path.of(TEST_SRC, "..", "..", "apps");
+ if (apps.toFile().exists()) {
+ root = apps.getParent().normalize(); // 2 levels down
+ } else {
+ apps = Path.of(TEST_SRC, "..", "..", "..", "apps");
+ if (apps.toFile().exists()) {
+ root = apps.getParent().normalize(); // 3 levels down
+ } else {
+ // if we ever have tests more than three levels
+ // down we need to add code here
+ throw new RuntimeException("we should never get here");
+ }
+ }
}
}
-
- TEST_SRC = System.getProperty("test.src");
+ TEST_SRC_ROOT = root.toString();
}
static final ToolProvider JPACKAGE_TOOL =
@@ -165,6 +167,7 @@
@Override
public FileVisitResult visitFile(Path file,
BasicFileAttributes attr) throws IOException {
+ file.toFile().setWritable(true);
if (OS.startsWith("win")) {
try {
Files.setAttribute(file, "dos:readonly", false);