test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageTest.java
branchJDK-8200758-branch
changeset 58696 61c44899b4eb
parent 58648 3bf53ffa9ae7
child 58762 0fe62353385b
--- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageTest.java	Fri Oct 18 11:00:57 2019 -0400
+++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageTest.java	Fri Oct 18 14:14:37 2019 -0400
@@ -33,6 +33,7 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import jdk.jpackage.test.Functional.ThrowingConsumer;
+import jdk.jpackage.internal.AppImageFile;
 import static jdk.jpackage.test.PackageType.*;
 
 /**
@@ -83,7 +84,8 @@
         return this;
     }
 
-    private PackageTest addInitializer(ThrowingConsumer<JPackageCommand> v, String id) {
+    private PackageTest addInitializer(ThrowingConsumer<JPackageCommand> v,
+            String id) {
         if (id != null) {
             if (namedInitializers.contains(id)) {
                 return this;
@@ -149,8 +151,10 @@
         return this;
     }
 
-    static void withTestFileAssociationsFile(FileAssociations fa, ThrowingConsumer<Path> consumer) {
-        final String testFileDefaultName = String.join(".", "test", fa.getSuffix());
+    static void withTestFileAssociationsFile(FileAssociations fa,
+            ThrowingConsumer<Path> consumer) {
+        final String testFileDefaultName = String.join(".", "test",
+                fa.getSuffix());
         TKit.withTempFile(testFileDefaultName, fa.getSuffix(), testFile -> {
             if (TKit.isLinux()) {
                 LinuxHelper.initFileAssociationsTestFile(testFile);
@@ -347,6 +351,9 @@
                 }
             }
 
+            TKit.assertPathExists(cmd.appInstallationDirectory().resolve(
+                    AppImageFile.FILENAME), false);
+
             installVerifiers.stream().forEach(v -> v.accept(cmd));
         }
 
@@ -413,7 +420,8 @@
             bundleOutputDir = new File(val).getAbsoluteFile();
 
             if (!bundleOutputDir.isDirectory()) {
-                throw new IllegalArgumentException(String.format("Invalid value of %s sytem property: [%s]. Should be existing directory",
+                throw new IllegalArgumentException(String.format(
+                        "Invalid value of %s sytem property: [%s]. Should be existing directory",
                         TKit.getConfigPropertyName(propertyName),
                         bundleOutputDir));
             }
@@ -425,7 +433,9 @@
         String action = Optional.ofNullable(TKit.getConfigProperty(propertyName)).orElse(
                 Action.CREATE.toString()).toLowerCase();
         DEFAULT_ACTION = Stream.of(Action.values()).filter(
-                a -> a.toString().equals(action)).findFirst().orElseThrow(() -> new IllegalArgumentException(String.format("Unrecognized value of %s property: [%s]",
+                a -> a.toString().equals(action)).findFirst().orElseThrow(
+                        () -> new IllegalArgumentException(String.format(
+                                "Unrecognized value of %s property: [%s]",
                                 TKit.getConfigPropertyName(propertyName), action)));
     }
 }