Skip to content

8303959: tools/jpackage/share/RuntimePackageTest.java fails with java.lang.AssertionError missing files #3470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions test/jdk/tools/jpackage/share/RuntimePackageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
Expand All @@ -34,6 +33,8 @@
import jdk.jpackage.test.JPackageCommand;
import jdk.jpackage.test.TKit;
import jdk.jpackage.test.Annotations.Test;
import jdk.jpackage.test.Executor;
import jdk.jpackage.test.JavaTool;
import jdk.jpackage.test.LinuxHelper;
import static jdk.jpackage.test.TKit.assertTrue;
import static jdk.jpackage.test.TKit.assertFalse;
Expand Down Expand Up @@ -101,9 +102,25 @@ private static PackageTest init(Set<PackageType> types) {
return new PackageTest()
.forTypes(types)
.addInitializer(cmd -> {
cmd.addArguments("--runtime-image", Optional.ofNullable(
JPackageCommand.DEFAULT_RUNTIME_IMAGE).orElse(Path.of(
System.getProperty("java.home"))));
final Path runtimeImageDir;
if (JPackageCommand.DEFAULT_RUNTIME_IMAGE != null) {
runtimeImageDir = JPackageCommand.DEFAULT_RUNTIME_IMAGE;
} else {
runtimeImageDir = TKit.createTempDirectory("runtime").resolve("data");

new Executor()
.setToolProvider(JavaTool.JLINK)
.dumpOutput()
.addArguments(
"--output", runtimeImageDir.toString(),
"--compress=0",
"--add-modules", "ALL-MODULE-PATH",
"--strip-debug",
"--no-header-files",
"--no-man-pages")
.execute();
}
cmd.addArguments("--runtime-image", runtimeImageDir);
// Remove --input parameter from jpackage command line as we don't
// create input directory in the test and jpackage fails
// if --input references non existant directory.
Expand Down