Skip to content

Commit

Permalink
Fix tests for JEP 493 enabled JDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
jerboaa committed Dec 6, 2024
1 parent ca506f8 commit a264230
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/jdk/tools/jpackage/TEST.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ exclusiveAccess.dirs=share windows
modules=jdk.jpackage/jdk.jpackage.internal:+open \
jdk.jpackage/jdk.jpackage.internal.util \
jdk.jpackage/jdk.jpackage.internal.util.function \
java.base/jdk.internal.util
java.base/jdk.internal.util \
jdk.jlink/jdk.tools.jlink.internal
9 changes: 9 additions & 0 deletions test/jdk/tools/jpackage/share/BasicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import jdk.jpackage.test.Annotations.Test;
import jdk.jpackage.test.Annotations.Parameter;
import jdk.jpackage.internal.util.function.ThrowingConsumer;
import jdk.tools.jlink.internal.LinkableRuntimeImage;
import static jdk.jpackage.test.RunnablePackageTest.Action.CREATE_AND_UNPACK;

/*
Expand Down Expand Up @@ -312,6 +313,14 @@ public void testNoOutputDir(boolean appImage) throws Throwable {
@Parameter("java.desktop,jdk.jartool")
@Parameter({ "java.desktop", "jdk.jartool" })
public void testAddModules(String... addModulesArg) {
if (addModulesArg.length == 1 && addModulesArg[0].equals("ALL-MODULE-PATH")) {
Path jmods = Path.of(System.getProperty("java.home"), "jmods");
boolean noJmods = Files.notExists(jmods);
if (LinkableRuntimeImage.isLinkableRuntime() && noJmods) {
System.out.println("ALL-MODULE-PATH test skipped for linkable run-time image");
return;
}
}
JPackageCommand cmd = JPackageCommand
.helloAppImage("goodbye.jar:com.other/com.other.Hello")
.ignoreDefaultRuntime(true); // because of --add-modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static void test() throws Exception {
.dumpOutput()
.addArguments(
"--output", jlinkOutputDir.toString(),
"--add-modules", "ALL-MODULE-PATH",
"--add-modules", "java.desktop",
"--strip-debug",
"--no-header-files",
"--no-man-pages",
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/tools/jpackage/share/RuntimeImageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static void test() throws Exception {
.dumpOutput()
.addArguments(
"--output", jlinkOutputDir.toString(),
"--add-modules", "ALL-MODULE-PATH",
"--add-modules", "java.desktop",
"--strip-debug",
"--no-header-files",
"--no-man-pages",
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/tools/jpackage/share/RuntimePackageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private static PackageTest init(Set<PackageType> types) {
.dumpOutput()
.addArguments(
"--output", runtimeImageDir.toString(),
"--add-modules", "ALL-MODULE-PATH",
"--add-modules", "java.desktop",
"--strip-debug",
"--no-header-files",
"--no-man-pages")
Expand Down

0 comments on commit a264230

Please sign in to comment.