Path: blob/master/test/jdk/tools/jpackage/linux/LinuxBundleNameTest.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.Annotations.Test;24import jdk.jpackage.test.PackageTest;25import jdk.jpackage.test.PackageType;262728/**29* Test --linux-package-name parameter. Output of the test should be30* quickbrownfox2_1.0-1_amd64.deb or quickbrownfox2-1.0-1.amd64.rpm package31* bundle. The output package should provide the same functionality as the32* default package.33*34* deb:35* Package property of the package should be set to quickbrownfox2.36*37* rpm:38* Name property of the package should be set to quickbrownfox2.39*/404142/*43* @test44* @summary jpackage with --linux-package-name45* @library ../helpers46* @key jpackagePlatformPackage47* @build jdk.jpackage.test.*48* @build LinuxBundleNameTest49* @requires (os.family == "linux")50* @modules jdk.jpackage/jdk.jpackage.internal51* @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main52* --jpt-run=LinuxBundleNameTest53*/54public class LinuxBundleNameTest {5556@Test57public static void test() {58final String PACKAGE_NAME = "quickbrownfox2";5960new PackageTest()61.forTypes(PackageType.LINUX)62.configureHelloApp()63.addInitializer(cmd -> {64cmd.addArguments("--linux-package-name", PACKAGE_NAME);65})66.forTypes(PackageType.LINUX_DEB)67.addBundlePropertyVerifier("Package", PACKAGE_NAME)68.forTypes(PackageType.LINUX_RPM)69.addBundlePropertyVerifier("Name", PACKAGE_NAME)70.run();71}72}737475