Skip to content
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

[WFCORE-7064] Do not set SM options on JDK24+ #6252

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ public static void setup() throws Exception {
@Test
public void testStandaloneWithAgent() throws Exception {
final StandaloneCommandBuilder builder = StandaloneCommandBuilder.of(ServerHelper.JBOSS_HOME)
.addJavaOptions(ServerHelper.DEFAULT_SERVER_JAVA_OPTS)
.setUseSecurityManager(parseProperty("security.manager"))
// Add the test logging agent to the jboss-modules arguments
.addModuleOption("-javaagent:" + ServerHelper.JBOSS_HOME.resolve("logging-agent-tests.jar") + "=" + LoggingAgent.DEBUG_ARG);
.addJavaOptions(ServerHelper.DEFAULT_SERVER_JAVA_OPTS);
// [WFCORE-7064] Setting SM is not allowed on JDK24+
if (Runtime.version().feature() < 24) {
builder.setUseSecurityManager(parseProperty("security.manager"));
}
// Add the test logging agent to the jboss-modules arguments
builder.addModuleOption("-javaagent:" + ServerHelper.JBOSS_HOME.resolve("logging-agent-tests.jar") + "=" + LoggingAgent.DEBUG_ARG);

final String localRepo = System.getProperty("maven.repo.local");
if (localRepo != null) {
Expand Down Expand Up @@ -85,8 +88,11 @@ public void testStandaloneWithAgent() throws Exception {
@Test
public void testDomainServerWithAgent() throws Exception {
final DomainCommandBuilder builder = DomainCommandBuilder.of(ServerHelper.JBOSS_HOME)
.addHostControllerJavaOptions(ServerHelper.DEFAULT_SERVER_JAVA_OPTS)
.setUseSecurityManager(parseProperty("security.manager"));
.addHostControllerJavaOptions(ServerHelper.DEFAULT_SERVER_JAVA_OPTS);
// [WFCORE-7064] Setting SM is not allowed on JDK24+
if (Runtime.version().feature() < 24) {
builder.setUseSecurityManager(parseProperty("security.manager"));
}

final String localRepo = System.getProperty("maven.repo.local");
if (localRepo != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public DomainScriptTestCase() {

@Parameterized.Parameters
public static Collection<Object> data() {
return List.of(Map.of(), Map.of("SECMGR", "true"));
return List.of(Map.of(), Map.of("SECMGR", SECMGR_VALUE));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
*/
public abstract class ScriptTestCase {

// [WFCORE-7064] Setting SM is not allowed on JDK24+
static final String SECMGR_VALUE = Runtime.version().feature() < 24 ? "true" : "false";
static final Map<String, String> MAVEN_JAVA_OPTS = new LinkedHashMap<>();

private final String scriptBaseName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static Collection<Object> data() {
Map.of(),
Map.of("GC_LOG", "true"),
Map.of("MODULE_OPTS", "-javaagent:logging-agent-tests.jar=" + LoggingAgent.DEBUG_ARG),
Map.of("SECMGR", "true")
Map.of("SECMGR", SECMGR_VALUE)
);
}

Expand Down
Loading