< prev index next >

test/jdk/tools/jpackage/linux/base/MaintainerBase.java

Print this page

        

@@ -51,13 +51,22 @@
         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);
+        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");
         }
     }
 
     private static void testCreateInstaller() throws Exception {
         JPackageHelper.executeCLI(true, CMD);
< prev index next >