Skip to content

Commit 2048dc2

Browse files
committed
Backport 458f033d4dd3c646028b2f9bab88f9a308cad4af
1 parent 7003684 commit 2048dc2

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

test/jdk/sun/management/jmxremote/bootstrap/AbstractFilePermissionTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
3535
import java.nio.file.attribute.PosixFilePermission;
3636
import java.util.ArrayList;
3737
import java.util.Arrays;
38-
import java.util.Collections;
3938
import java.util.HashSet;
4039
import java.util.List;
4140
import java.util.Set;
@@ -47,7 +46,6 @@
4746
* @author Taras Ledkov
4847
*/
4948
public abstract class AbstractFilePermissionTest {
50-
private final String TEST_CLASS_PATH = System.getProperty("test.class.path");
5149
protected final String TEST_CLASSES = System.getProperty("test.classes");
5250
protected final FileSystem FS = FileSystems.getDefault();
5351
private int MAX_GET_FREE_PORT_TRIES = 10;
@@ -169,11 +167,8 @@ private int doTest() throws Exception {
169167
final String pp = "-Dcom.sun.management.jmxremote.port=" + jdk.test.lib.Utils.getFreePort();
170168

171169
List<String> command = new ArrayList<>();
172-
Collections.addAll(command, jdk.test.lib.Utils.getTestJavaOpts());
173170
command.add(mp);
174171
command.add(pp);
175-
command.add("-cp");
176-
command.add(TEST_CLASSES);
177172
command.add(className);
178173

179174
ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(command);

test/jdk/sun/management/jmxremote/bootstrap/LocalManagementTest.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,12 +24,10 @@
2424
import java.lang.reflect.Method;
2525
import java.lang.reflect.Modifier;
2626
import java.util.ArrayList;
27-
import java.util.Collections;
2827
import java.util.List;
2928
import java.util.concurrent.atomic.AtomicReference;
3029

3130
import jdk.test.lib.process.ProcessTools;
32-
import jdk.test.lib.Utils;
3331

3432
/**
3533
* @test
@@ -48,7 +46,6 @@
4846
* @run main/othervm/timeout=300 LocalManagementTest
4947
*/
5048
public class LocalManagementTest {
51-
private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
5249

5350
public static void main(String[] args) throws Exception {
5451
int failures = 0;
@@ -99,16 +96,13 @@ private static boolean test5() throws Exception {
9996
private static boolean doTest(String testId, String arg) throws Exception {
10097
List<String> args = new ArrayList<>();
10198
args.add("-XX:+UsePerfData");
102-
Collections.addAll(args, Utils.getTestJavaOpts());
103-
args.add("-cp");
104-
args.add(TEST_CLASSPATH);
10599

106100
if (arg != null) {
107101
args.add(arg);
108102
}
109103
args.add("TestApplication");
110104
ProcessBuilder server = ProcessTools.createTestJavaProcessBuilder(
111-
args.toArray(new String[args.size()])
105+
args.toArray(new String[0])
112106
);
113107

114108
Process serverPrc = null, clientPrc = null;
@@ -134,8 +128,6 @@ private static boolean doTest(String testId, String arg) throws Exception {
134128
System.out.println(" shutdown port : " + port.get());
135129

136130
ProcessBuilder client = ProcessTools.createTestJavaProcessBuilder(
137-
"-cp",
138-
TEST_CLASSPATH,
139131
"--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED",
140132
"TestManager",
141133
String.valueOf(serverPrc.pid()),

test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
2828
import java.io.BufferedReader;
2929
import java.io.BufferedWriter;
3030
import java.io.IOException;
31-
import java.net.BindException;
3231
import java.nio.charset.Charset;
3332
import java.nio.file.FileSystem;
3433
import java.nio.file.FileSystems;
@@ -180,12 +179,9 @@ private int doTest(String... args) throws Exception {
180179
initTestEnvironment();
181180

182181
List<String> command = new ArrayList<>();
183-
Collections.addAll(command, Utils.getTestJavaOpts());
184182
command.add("-Dtest.src=" + TEST_SRC);
185183
command.add("-Dtest.rmi.port=" + port);
186184
command.addAll(Arrays.asList(args));
187-
command.add("-cp");
188-
command.add(TEST_CLASS_PATH);
189185
command.add(className);
190186

191187
ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(command);

0 commit comments

Comments
 (0)