test/jdk/tools/jpackage/linux/base/LicenseTypeBase.java
branchJDK-8200758-branch
changeset 57742 e3d4b9bc5093
parent 57543 bcd1ab268a7d
child 57910 28412b313c6b
equal deleted inserted replaced
57741:38856ef4a19c 57742:e3d4b9bc5093
    41     }
    41     }
    42 
    42 
    43     private static final String infoResult = "infoResult.txt";
    43     private static final String infoResult = "infoResult.txt";
    44     private static void validatePackage() throws Exception {
    44     private static void validatePackage() throws Exception {
    45         int retVal = JPackageHelper.execute(new File(infoResult),"rpm",
    45         int retVal = JPackageHelper.execute(new File(infoResult),"rpm",
    46                 "--query", "--package", "--info", OUTPUT.toLowerCase());
    46                 "-qp", "--queryformat", "%{license}", OUTPUT.toLowerCase());
    47         if (retVal != 0) {
    47         if (retVal != 0) {
    48             throw new AssertionError("rpm exited with error: " + retVal);
    48             throw new AssertionError("rpm exited with error: " + retVal);
    49         }
    49         }
    50 
    50 
    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         String output = Files.readString(outfile.toPath());
    57         if (!output.contains(JP_LICENSE_TYPE)) {
    57         if (!output.equals(JP_LICENSE_TYPE)) {
    58             throw new AssertionError("Unexpected result: " + output);
    58             throw new AssertionError("Unexpected result: " + output);
    59         }
    59         }
    60     }
    60     }
    61 
    61 
    62     private static void testCreateInstaller() throws Exception {
    62     private static void testCreateInstaller() throws Exception {