Path: blob/master/test/jdk/tools/jpackage/linux/ReleaseTest.java
41149 views
/*1* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223import jdk.jpackage.test.PackageType;24import jdk.jpackage.test.PackageTest;25import jdk.jpackage.test.Annotations.Test;262728/**29* Test --linux-app-release parameter. Output of the test should be30* releasetest_1.0-Rc3_amd64.deb or releasetest-1.0-Rc3.amd64.rpm package31* bundle. The output package should provide the same functionality as the32* default package.33*34* deb:35* Version property of the package should end with -Rc3 substring.36*37* rpm:38* Release property of the package should be set to Rc3 value.39*/4041/*42* @test43* @summary jpackage with --linux-app-release44* @library ../helpers45* @key jpackagePlatformPackage46* @build jdk.jpackage.test.*47* @build ReleaseTest48* @requires (os.family == "linux")49* @modules jdk.jpackage/jdk.jpackage.internal50* @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main51* --jpt-run=ReleaseTest52*/53public class ReleaseTest {5455@Test56public static void test() {57final String RELEASE = "Rc3";5859new PackageTest()60.forTypes(PackageType.LINUX)61.configureHelloApp()62.addInitializer(cmd -> {63cmd.addArguments("--linux-app-release", RELEASE);64})65.forTypes(PackageType.LINUX_RPM)66.addBundlePropertyVerifier("Release", RELEASE)67.forTypes(PackageType.LINUX_DEB)68.addBundlePropertyVerifier("Version", propValue -> {69return propValue.endsWith("-" + RELEASE);70}, "ends with")71.run();72}73}747576