< prev index next >

test/jdk/tools/jpackage/share/LicenseTest.java

Print this page

        

*** 97,118 **** .forTypes(PackageType.LINUX) .addBundleVerifier(cmd -> { verifyLicenseFileInLinuxPackage(cmd, linuxLicenseFile(cmd)); }) .addInstallVerifier(cmd -> { ! TKit.assertReadableFileExists(linuxLicenseFile(cmd)); }) .addUninstallVerifier(cmd -> { verifyLicenseFileNotInstalledLinux(linuxLicenseFile(cmd)); }) .forTypes(PackageType.LINUX_DEB) .addInstallVerifier(cmd -> { verifyLicenseFileInstalledDebian(debLicenseFile(cmd)); }) .forTypes(PackageType.LINUX_RPM) .addInstallVerifier(cmd -> { ! verifyLicenseFileInstalledRpm(rpmLicenseFile(cmd)); }) .run(); } public static void testCustomDebianCopyright() { --- 97,124 ---- .forTypes(PackageType.LINUX) .addBundleVerifier(cmd -> { verifyLicenseFileInLinuxPackage(cmd, linuxLicenseFile(cmd)); }) .addInstallVerifier(cmd -> { ! Path path = linuxLicenseFile(cmd); ! if (path != null) { ! TKit.assertReadableFileExists(path); ! } }) .addUninstallVerifier(cmd -> { verifyLicenseFileNotInstalledLinux(linuxLicenseFile(cmd)); }) .forTypes(PackageType.LINUX_DEB) .addInstallVerifier(cmd -> { verifyLicenseFileInstalledDebian(debLicenseFile(cmd)); }) .forTypes(PackageType.LINUX_RPM) .addInstallVerifier(cmd -> { ! Path path = rpmLicenseFile(cmd); ! if (path != null) { ! verifyLicenseFileInstalledRpm(path); ! } }) .run(); } public static void testCustomDebianCopyright() {
*** 122,131 **** --- 128,141 ---- public static void testCustomDebianCopyrightSubst() { new CustomDebianCopyrightTest().withSubstitution(true).run(); } private static Path rpmLicenseFile(JPackageCommand cmd) { + if (cmd.isPackageUnpacked("Not checking for rpm license file")) { + return null; + } + final Path licenseRoot = Path.of( new Executor() .setExecutable("rpm") .addArguments("--eval", "%{_defaultlicensedir}") .executeAndGetFirstLineOfOutput());
*** 234,244 **** return this; } void run() { final Path srcLicenseFile = TKit.workDir().resolve("license"); ! new PackageTest().configureHelloApp().forTypes(PackageType.LINUX_DEB) .addInitializer(cmd -> { // Create source license file. Files.write(srcLicenseFile, List.of( licenseText.split("\\R", -1))); --- 244,254 ---- return this; } void run() { final Path srcLicenseFile = TKit.workDir().resolve("license"); ! new PackageTest().forTypes(PackageType.LINUX_DEB).configureHelloApp() .addInitializer(cmd -> { // Create source license file. Files.write(srcLicenseFile, List.of( licenseText.split("\\R", -1)));
< prev index next >