test/jdk/tools/jpackage/linux/base/MaintainerBase.java
branchJDK-8200758-branch
changeset 57808 013547ae70ac
parent 57543 bcd1ab268a7d
child 57909 c7de06ed4b54
equal deleted inserted replaced
57807:4a15115716ea 57808:013547ae70ac
    51         File outfile = new File(infoResult);
    51         File outfile = new File(infoResult);
    52         if (!outfile.exists()) {
    52         if (!outfile.exists()) {
    53             throw new AssertionError(infoResult + " was not created");
    53             throw new AssertionError(infoResult + " was not created");
    54         }
    54         }
    55 
    55 
    56         String output = Files.readString(outfile.toPath());
    56         boolean maintainerFound = false;
    57         if (!output.contains("Maintainer: " + EMAIL)) {
    57         for (String line: Files.readAllLines(outfile.toPath())) {
    58             throw new AssertionError("Unexpected result: " + output);
    58             if (line.matches("^[ ]*Maintainer:.*$")) {
       
    59                 maintainerFound = true;
       
    60                 if (!line.contains(EMAIL)) {
       
    61                     throw new AssertionError("Unexpected result: " + line);
       
    62                 }
       
    63             }
       
    64         }
       
    65         
       
    66         if (!maintainerFound) {
       
    67             throw new AssertionError("Maintainer field not found");
    59         }
    68         }
    60     }
    69     }
    61 
    70 
    62     private static void testCreateInstaller() throws Exception {
    71     private static void testCreateInstaller() throws Exception {
    63         JPackageHelper.executeCLI(true, CMD);
    72         JPackageHelper.executeCLI(true, CMD);