|
29 | 29 | import java.util.function.Predicate;
|
30 | 30 | import java.util.stream.Collectors;
|
31 | 31 | import jdk.jpackage.test.PackageType;
|
| 32 | +import jdk.jpackage.test.RunnablePackageTest.Action; |
32 | 33 | import jdk.jpackage.test.PackageTest;
|
33 | 34 | import jdk.jpackage.test.JPackageCommand;
|
34 | 35 | import jdk.jpackage.test.TKit;
|
35 | 36 | import jdk.jpackage.test.Annotations.Test;
|
| 37 | +import jdk.jpackage.test.Annotations.Parameter; |
36 | 38 | import jdk.jpackage.test.Executor;
|
37 | 39 | import jdk.jpackage.test.JavaTool;
|
38 | 40 | import jdk.jpackage.test.LinuxHelper;
|
@@ -83,17 +85,24 @@ public static void test() {
|
83 | 85 | }
|
84 | 86 |
|
85 | 87 | @Test
|
86 |
| - public static void testUsrInstallDir() { |
| 88 | + @Parameter("/usr") |
| 89 | + @Parameter("/usr/lib/Java") |
| 90 | + public static void testUsrInstallDir(String installDir) { |
87 | 91 | init(PackageType.LINUX)
|
88 | 92 | .addInitializer(cmd -> cmd.addArguments("--install-dir", "/usr"))
|
89 | 93 | .run();
|
90 | 94 | }
|
91 | 95 |
|
92 | 96 | @Test
|
93 |
| - public static void testUsrInstallDir2() { |
94 |
| - init(PackageType.LINUX) |
95 |
| - .addInitializer(cmd -> cmd.addArguments("--install-dir", "/usr/lib/Java")) |
96 |
| - .run(); |
| 97 | + public static void testName() { |
| 98 | + // Test that jpackage can derive package name from the path to runtime image. |
| 99 | + init(PackageType.NATIVE) |
| 100 | + .addInitializer(cmd -> cmd.removeArgumentWithValue("--name")) |
| 101 | + // Don't attempt to install this package as it may have an odd name derived from |
| 102 | + // the runtime image path. Say, on Linux for `--runtime-image foo/bar/sed` |
| 103 | + // command line jpackage will create a package named 'sed' that will conflict |
| 104 | + // with the default 'sed' package. |
| 105 | + .run(Action.CREATE_AND_UNPACK); |
97 | 106 | }
|
98 | 107 |
|
99 | 108 | private static PackageTest init(Set<PackageType> types) {
|
@@ -157,7 +166,8 @@ private static PackageTest init(Set<PackageType> types) {
|
157 | 166 | "Check the package doesn't deliver [%s] copyright file",
|
158 | 167 | copyright));
|
159 | 168 | }
|
160 |
| - }); |
| 169 | + }) |
| 170 | + .forTypes(types); |
161 | 171 | }
|
162 | 172 |
|
163 | 173 | private static Set<Path> listFiles(Path root) throws IOException {
|
|
0 commit comments