test/jdk/tools/jpackage/linux/base/MaintainerBase.java
branchJDK-8200758-branch
changeset 57808 013547ae70ac
parent 57543 bcd1ab268a7d
child 57909 c7de06ed4b54
--- a/test/jdk/tools/jpackage/linux/base/MaintainerBase.java	Mon Aug 19 17:39:48 2019 -0400
+++ b/test/jdk/tools/jpackage/linux/base/MaintainerBase.java	Mon Aug 19 20:31:10 2019 -0400
@@ -53,9 +53,18 @@
             throw new AssertionError(infoResult + " was not created");
         }
 
-        String output = Files.readString(outfile.toPath());
-        if (!output.contains("Maintainer: " + EMAIL)) {
-            throw new AssertionError("Unexpected result: " + output);
+        boolean maintainerFound = false;
+        for (String line: Files.readAllLines(outfile.toPath())) {
+            if (line.matches("^[ ]*Maintainer:.*$")) {
+                maintainerFound = true;
+                if (!line.contains(EMAIL)) {
+                    throw new AssertionError("Unexpected result: " + line);
+                }
+            }
+        }
+        
+        if (!maintainerFound) {
+            throw new AssertionError("Maintainer field not found");
         }
     }