diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index c298a74dc25..0fdbdae9bc5 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -101,6 +101,7 @@ requires.properties= \ container.support \ systemd.support \ jdk.containerized \ + jdk.explodedImage \ jlink.runtime.linkable \ jlink.packagedModules \ jdk.static diff --git a/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java b/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java index 0cd3e371d8b..f0d29e83e01 100644 --- a/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java +++ b/test/hotspot/jtreg/runtime/getSysPackage/GetSysPkgTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @modules java.base/jdk.internal.loader * java.logging * @requires vm.flagless + * @requires !jdk.explodedImage * @library /test/lib * @run driver GetSysPkgTest */ diff --git a/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java b/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java index 18d618cf8bc..d552a6158f3 100644 --- a/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java +++ b/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, Google Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,6 +28,7 @@ * @bug 8220095 * @requires os.family == "linux" | os.family == "mac" * @requires vm.flagless + * @requires !jdk.explodedImage * @requires !jdk.static * @library /test/lib * @modules java.management diff --git a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java index dd8b33402ac..4750e95c828 100644 --- a/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java +++ b/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary Make sure -Xlog:class+load=info works properly with "modules" jimage, --patch-module, and with -Xbootclasspath/a * @requires vm.flagless + * @requires !jdk.explodedImage * @modules java.base/jdk.internal.misc * @library /test/lib * @compile PatchModuleMain.java diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index dbc7a916885..70e619f3d3d 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -146,6 +146,7 @@ public class VMProps implements Callable> { map.put("jdk.containerized", this::jdkContainerized); map.put("vm.flagless", this::isFlagless); map.put("jdk.foreign.linker", this::jdkForeignLinker); + map.put("jdk.explodedImage", this::explodedImage); map.put("jlink.packagedModules", this::packagedModules); map.put("jdk.static", this::isStatic); vmGC(map); // vm.gc.X = true/false @@ -751,6 +752,20 @@ public class VMProps implements Callable> { return "" + "true".equalsIgnoreCase(isEnabled); } + private String explodedImage() { + try { + Path jmodFile = Path.of(System.getProperty("java.home"), "jmods", "java.base.jmod"); + if (Files.exists(jmodFile)) { + return Boolean.FALSE.toString(); + } else { + return Boolean.TRUE.toString(); + } + } catch (Throwable t) { + t.printStackTrace(); + return errorWithMessage("Error in explodedImage " + t); + } + } + private String packagedModules() { // Some jlink tests require packaged modules being present (jmods). // For a runtime linkable image build packaged modules aren't present