Skip to content

Commit

Permalink
8319648: java/lang/SecurityManager tests ignore vm flags
Browse files Browse the repository at this point in the history
Reviewed-by: mullan
  • Loading branch information
Matthew Donovan committed Mar 1, 2024
1 parent e85265a commit 437cf35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024, 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
Expand Down Expand Up @@ -64,7 +64,7 @@ public Object[][] testCases() {

@Test(dataProvider = "testCases")
public void testProvider(List<String> args) throws Throwable {
ProcessBuilder processBuilder = ProcessTools.createLimitedTestJavaProcessBuilder(args);
ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(args);
OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(processBuilder);
outputAnalyzer.shouldHaveExitValue(0);
}
Expand Down
10 changes: 4 additions & 6 deletions test/jdk/java/lang/System/SecurityManagerWarnings.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, 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
Expand Down Expand Up @@ -28,7 +28,6 @@
* @library /test/lib
*/

import jdk.test.lib.JDKToolFinder;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.util.JarUtils;
Expand All @@ -51,6 +50,7 @@ public static void main(String args[]) throws Exception {
};
""");

System.setProperty("test.noclasspath", "true");
String testClasses = System.getProperty("test.classes");

disallowTest(null, testClasses);
Expand Down Expand Up @@ -131,13 +131,11 @@ static OutputAnalyzer checkInstallMessage(OutputAnalyzer oa, String cp) {
static OutputAnalyzer run(String prop, String cp) throws Exception {
ProcessBuilder pb;
if (prop == null) {
pb = new ProcessBuilder(
JDKToolFinder.getJDKTool("java"),
pb = ProcessTools.createTestJavaProcessBuilder(
"-cp", cp,
"SecurityManagerWarnings", "run");
} else {
pb = new ProcessBuilder(
JDKToolFinder.getJDKTool("java"),
pb = ProcessTools.createTestJavaProcessBuilder(
"-cp", cp,
"-Djava.security.manager=" + prop,
"-Djava.security.policy=policy",
Expand Down

3 comments on commit 437cf35

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 437cf35 Mar 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 437cf35 Mar 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-437cf354 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 437cf354 from the openjdk/jdk repository.

The commit being backported was authored by Matthew Donovan on 1 Mar 2024 and was reviewed by Sean Mullan.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-437cf354:backport-GoeLin-437cf354
$ git checkout backport-GoeLin-437cf354
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-437cf354

Please sign in to comment.