diff --git a/test/hotspot/jtreg/compiler/c2/Test8062950.java b/test/hotspot/jtreg/compiler/c2/Test8062950.java index 3d7db33b6d4..951626fcab9 100644 --- a/test/hotspot/jtreg/compiler/c2/Test8062950.java +++ b/test/hotspot/jtreg/compiler/c2/Test8062950.java @@ -36,10 +36,10 @@ public class Test8062950 { private static final String CLASSNAME = "DoesNotExist"; public static void main(String[] args) throws Exception { - ProcessTools.executeTestJvm("-Xcomp", - "-XX:-TieredCompilation", - "-XX:-UseOptoBiasInlining", - CLASSNAME) + ProcessTools.executeTestJava("-Xcomp", + "-XX:-TieredCompilation", + "-XX:-UseOptoBiasInlining", + CLASSNAME) .shouldHaveExitValue(1) .shouldContain("Error: Could not find or load main class " + CLASSNAME) .shouldNotContain("A fatal error has been detected") diff --git a/test/hotspot/jtreg/compiler/c2/cr7200264/TestDriver.java b/test/hotspot/jtreg/compiler/c2/cr7200264/TestDriver.java index 8fc1fa0580d..9975fd7511c 100644 --- a/test/hotspot/jtreg/compiler/c2/cr7200264/TestDriver.java +++ b/test/hotspot/jtreg/compiler/c2/cr7200264/TestDriver.java @@ -44,7 +44,7 @@ public void run() throws Throwable { } private List executeApplication() throws Throwable { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( "-Xbatch", "-XX:-TieredCompilation", "-XX:+PrintCompilation", diff --git a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java index 356f549d231..86e976e1a05 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java @@ -92,9 +92,9 @@ static void test(int i) { static { try { - CLIENT_VM_AVAILABLE = ProcessTools.executeTestJvm(CLIENT_VM_OPTION, VERSION_OPTION) + CLIENT_VM_AVAILABLE = ProcessTools.executeTestJava(CLIENT_VM_OPTION, VERSION_OPTION) .getOutput().contains("Client"); - SERVER_VM_AVAILABLE = ProcessTools.executeTestJvm(SERVER_VM_OPTION, VERSION_OPTION) + SERVER_VM_AVAILABLE = ProcessTools.executeTestJava(SERVER_VM_OPTION, VERSION_OPTION) .getOutput().contains("Server"); } catch(Throwable t) { throw new Error("Initialization failed: " + t, t); diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java index c65c3b4846b..9833bb7235e 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java @@ -36,13 +36,13 @@ public class OptionTest { public static void main(String[] args) throws Exception { - ProcessTools.executeTestJvm("-XX:CompileCommand=option,package/class,ccstrlist,ControlIntrinsic,+_id", "-version") + ProcessTools.executeTestJava("-XX:CompileCommand=option,package/class,ccstrlist,ControlIntrinsic,+_id", "-version") .shouldHaveExitValue(0) .shouldContain("CompileCommand: An error occurred during parsing") .shouldContain("Error: Did not specify any method name") .shouldNotContain("# A fatal error has been detected by the Java Runtime Environment"); - ProcessTools.executeTestJvm("-XX:CompileCommand=option,*,ccstrlist,ControlIntrinsic,+_id", "-version") + ProcessTools.executeTestJava("-XX:CompileCommand=option,*,ccstrlist,ControlIntrinsic,+_id", "-version") .shouldHaveExitValue(0) .shouldContain("CompileCommand: An error occurred during parsing") .shouldContain("Error: Did not specify any method name") @@ -50,35 +50,35 @@ public static void main(String[] args) throws Exception { // corner case: // ccstrlist could be a valid method name, so it is accepted in the well-formed case. - ProcessTools.executeTestJvm("-XX:CompileCommand=option,*.ccstrlist,ccstrlist,ControlIntrinsic,+_id", "-version") + ProcessTools.executeTestJava("-XX:CompileCommand=option,*.ccstrlist,ccstrlist,ControlIntrinsic,+_id", "-version") .shouldContain("CompileCommand: ControlIntrinsic *.ccstrlist const char* ControlIntrinsic") .shouldHaveExitValue(0) .shouldNotContain("# A fatal error has been detected by the Java Runtime Environment"); - ProcessTools.executeTestJvm("-XX:CompileCommand=option,*.*,ccstrlist,ControlIntrinsic,+_id", "-version") + ProcessTools.executeTestJava("-XX:CompileCommand=option,*.*,ccstrlist,ControlIntrinsic,+_id", "-version") .shouldContain("CompileCommand: ControlIntrinsic *.* const char* ControlIntrinsic") .shouldHaveExitValue(0) .shouldNotContain("# A fatal error has been detected by the Java Runtime Environment"); - ProcessTools.executeTestJvm("-XX:CompileCommand=option,class,PrintIntrinsics", "-version") + ProcessTools.executeTestJava("-XX:CompileCommand=option,class,PrintIntrinsics", "-version") .shouldHaveExitValue(0) .shouldNotContain("# A fatal error has been detected by the Java Runtime Environment"); // corner case: // PrintIntrinsics could be a valid method name, so it is accepted in the well-formed case. - ProcessTools.executeTestJvm("-XX:CompileCommand=option,class.PrintIntrinsics,PrintIntrinsics", "-version") + ProcessTools.executeTestJava("-XX:CompileCommand=option,class.PrintIntrinsics,PrintIntrinsics", "-version") .shouldContain("CompileCommand: PrintIntrinsics class.PrintIntrinsics bool PrintIntrinsics = true") .shouldHaveExitValue(0) .shouldNotContain("# A fatal error has been detected by the Java Runtime Environment"); // corner case: // _dontinline_* is a valid method pattern, so it should be accepted - ProcessTools.executeTestJvm("-XX:CompileCommand=dontinline,*::dontinline_*", "-version") + ProcessTools.executeTestJava("-XX:CompileCommand=dontinline,*::dontinline_*", "-version") .shouldContain("CompileCommand: dontinline *.dontinline_* bool dontinline = true") .shouldHaveExitValue(0) .shouldNotContain("# A fatal error has been detected by the Java Runtime Environment"); - ProcessTools.executeTestJvm("-XX:CompileCommand=dontinline,*.dontinline", "-version") + ProcessTools.executeTestJava("-XX:CompileCommand=dontinline,*.dontinline", "-version") .shouldContain("CompileCommand: dontinline *.dontinline bool dontinline = true") .shouldHaveExitValue(0) .shouldNotContain("Error: Did not specify any method name") diff --git a/test/hotspot/jtreg/compiler/compilercontrol/parser/HugeDirectiveUtil.java b/test/hotspot/jtreg/compiler/compilercontrol/parser/HugeDirectiveUtil.java index 6db9a995862..d337266dd50 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/parser/HugeDirectiveUtil.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/parser/HugeDirectiveUtil.java @@ -121,7 +121,7 @@ private static List getRandomDescriptors( protected static OutputAnalyzer execute(String fileName) { OutputAnalyzer output; try { - output = ProcessTools.executeTestJvm( + output = ProcessTools.executeTestJava( "-XX:+UnlockDiagnosticVMOptions", "-XX:CompilerDirectivesLimit=1000", "-XX:CompilerDirectivesFile=" + fileName, diff --git a/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java b/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java index e129bf7ab48..2b4845a34df 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java @@ -46,7 +46,7 @@ public static void main(String[] args) throws Exception { } public static void test(String compileOnlyCommand) throws Exception { - OutputAnalyzer output = ProcessTools.executeTestJvm("-XX:CompileOnly=" + compileOnlyCommand, "-version"); + OutputAnalyzer output = ProcessTools.executeTestJava("-XX:CompileOnly=" + compileOnlyCommand, "-version"); output.shouldHaveExitValue(0); } } diff --git a/test/hotspot/jtreg/compiler/compilercontrol/share/scenario/Executor.java b/test/hotspot/jtreg/compiler/compilercontrol/share/scenario/Executor.java index 8a868e89ee6..30222ace4a2 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/share/scenario/Executor.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/share/scenario/Executor.java @@ -105,7 +105,7 @@ public List execute() { vmInputArgs.length + vmOptions.size()); System.arraycopy(vmOptions.toArray(), 0, cmds, vmInputArgs.length, vmOptions.size()); - output = ProcessTools.executeTestJvm(cmds); + output = ProcessTools.executeTestJava(cmds); } catch (Throwable thr) { throw new Error("Execution failed: " + thr.getMessage(), thr); } diff --git a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java index 4c56daebfb8..ac3a6d9a8c6 100644 --- a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java +++ b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -72,7 +72,7 @@ private boolean isTieredLevelGreaterThan(int level) { * @throws Throwable */ private void testUseAES() throws Throwable { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( prepareArguments(prepareBooleanFlag(AESIntrinsicsBase .USE_AES, true))); final String errorMessage = "Case testUseAES failed"; @@ -103,7 +103,7 @@ private void testUseAES() throws Throwable { */ private void testUseAESUseSSE2() throws Throwable { if (Platform.isX86() || Platform.isX64()) { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( prepareArguments(prepareBooleanFlag(AESIntrinsicsBase .USE_AES_INTRINSICS, true), prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2))); @@ -132,7 +132,7 @@ private void testUseAESUseSSE2() throws Throwable { */ private void testNoUseAESUseSSE2() throws Throwable { if (Platform.isX86() || Platform.isX64()) { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( prepareArguments(prepareBooleanFlag(AESIntrinsicsBase .USE_AES, false), prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2))); @@ -158,7 +158,7 @@ private void testNoUseAESUseSSE2() throws Throwable { * @throws Throwable */ private void testNoUseAES() throws Throwable { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( prepareArguments(prepareBooleanFlag(AESIntrinsicsBase .USE_AES, false))); final String errorMessage = "Case testNoUseAES failed"; @@ -180,7 +180,7 @@ private void testNoUseAES() throws Throwable { * @throws Throwable */ private void testNoUseAESIntrinsic() throws Throwable { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( prepareArguments(prepareBooleanFlag(AESIntrinsicsBase .USE_AES_INTRINSICS, false))); final String errorMessage = "Case testNoUseAESIntrinsic failed"; diff --git a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java index 03016ea3dd6..fdc8f63f9e0 100644 --- a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java +++ b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -65,7 +65,7 @@ protected void runTestCases() throws Throwable { * @throws Throwable */ private void testUseAESIntrinsics() throws Throwable { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( AESIntrinsicsBase.prepareArguments(prepareBooleanFlag( AESIntrinsicsBase.USE_AES_INTRINSICS, true))); final String errorMessage = "Case testUseAESIntrinsics failed"; @@ -89,7 +89,7 @@ private void testUseAESIntrinsics() throws Throwable { * @throws Throwable */ private void testUseAES() throws Throwable { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( AESIntrinsicsBase.prepareArguments(prepareBooleanFlag (AESIntrinsicsBase.USE_AES, true))); final String errorMessage = "Case testUseAES failed"; diff --git a/test/hotspot/jtreg/compiler/gcbarriers/TestMembarDependencies.java b/test/hotspot/jtreg/compiler/gcbarriers/TestMembarDependencies.java index bbd518c6756..3678691b218 100644 --- a/test/hotspot/jtreg/compiler/gcbarriers/TestMembarDependencies.java +++ b/test/hotspot/jtreg/compiler/gcbarriers/TestMembarDependencies.java @@ -43,7 +43,7 @@ public class TestMembarDependencies { public static void main(String args[]) throws Exception { if (args.length == 0) { // For debugging, add "-XX:+TraceOptoPipelining" - OutputAnalyzer oa = ProcessTools.executeTestJvm("-XX:+IgnoreUnrecognizedVMOptions", + OutputAnalyzer oa = ProcessTools.executeTestJava("-XX:+IgnoreUnrecognizedVMOptions", "-XX:-TieredCompilation", "-XX:-BackgroundCompilation", "-XX:+PrintOpto", "-XX:CompileCommand=compileonly,compiler.membars.TestMembarDependencies::test*", "-XX:CompileCommand=dontinline,compiler.membars.TestMembarDependencies::test_m1", diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/BMITestRunner.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/BMITestRunner.java index 4060bacbfba..159e471e3fc 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/BMITestRunner.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/BMITestRunner.java @@ -146,7 +146,7 @@ public static OutputAnalyzer runTest(Class expr, new Integer(iterations).toString() }); - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(vmOpts); + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(vmOpts); outputAnalyzer.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/FlagVMProcess.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/FlagVMProcess.java index c39b045b07f..ec57979ca8e 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/FlagVMProcess.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/FlagVMProcess.java @@ -112,7 +112,7 @@ private void prepareVMFlags(Class testClass, List additionalFlags) { private void start() { try { // Run "flag" VM with White Box access to determine the test VM flags and if IR verification should be done. - oa = ProcessTools.executeTestJvm(cmds); + oa = ProcessTools.executeTestJava(cmds); } catch (Exception e) { throw new TestRunException("Failed to execute TestFramework flag VM", e); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java index 771f18d6b96..52dbc72fc4c 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java @@ -149,7 +149,7 @@ private void start() { ProcessBuilder process = ProcessTools.createLimitedTestJavaProcessBuilder(cmds); try { // Calls 'main' of TestVM to run all specified tests with commands 'cmds'. - // Use executeProcess instead of executeTestJvm as we have already added the JTreg VM and + // Use executeProcess instead of executeTestJava as we have already added the JTreg VM and // Java options in prepareTestVMFlags(). oa = ProcessTools.executeProcess(process); } catch (Exception e) { diff --git a/test/hotspot/jtreg/compiler/loopopts/UseCountedLoopSafepointsTest.java b/test/hotspot/jtreg/compiler/loopopts/UseCountedLoopSafepointsTest.java index a971c947ff4..effbbbe46bd 100644 --- a/test/hotspot/jtreg/compiler/loopopts/UseCountedLoopSafepointsTest.java +++ b/test/hotspot/jtreg/compiler/loopopts/UseCountedLoopSafepointsTest.java @@ -59,9 +59,10 @@ public static void main (String args[]) { private static void check(boolean enabled) { OutputAnalyzer oa; try { - oa = ProcessTools.executeTestJvm("-XX:+UnlockDiagnosticVMOptions", "-Xbootclasspath/a:.", - "-XX:" + (enabled ? "+" : "-") + "UseCountedLoopSafepoints", - "-XX:+WhiteBoxAPI", + oa = ProcessTools.executeTestJava( + "-XX:+UnlockDiagnosticVMOptions", "-Xbootclasspath/a:.", + "-XX:" + (enabled ? "+" : "-") + "UseCountedLoopSafepoints", + "-XX:+WhiteBoxAPI", "-XX:-Inline", "-Xbatch", "-XX:+PrintIdeal", "-XX:LoopUnrollLimit=0", "-XX:CompileOnly=" + UseCountedLoopSafepoints.class.getName() + "::testMethod", UseCountedLoopSafepoints.class.getName()); diff --git a/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMining.java b/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMining.java index c76ce6459df..938129ba30f 100644 --- a/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMining.java +++ b/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMining.java @@ -38,7 +38,7 @@ public class CheckLoopStripMining { public static void main(String args[]) throws Exception { - ProcessTools.executeTestJvm("-XX:+UnlockDiagnosticVMOptions", + ProcessTools.executeTestJava("-XX:+UnlockDiagnosticVMOptions", // to prevent biased locking handshakes from changing the timing of this test "-XX:-UseBiasedLocking", "-XX:+SafepointTimeout", @@ -56,7 +56,7 @@ public static void main(String args[]) throws Exception { .shouldHaveExitValue(0) .stdoutShouldContain("sum: 715827882"); - ProcessTools.executeTestJvm("-XX:+UnlockDiagnosticVMOptions", + ProcessTools.executeTestJava("-XX:+UnlockDiagnosticVMOptions", // to prevent biased locking handshakes from changing the timing of this test "-XX:-UseBiasedLocking", "-XX:+SafepointTimeout", diff --git a/test/hotspot/jtreg/compiler/runtime/TestConstantsInError.java b/test/hotspot/jtreg/compiler/runtime/TestConstantsInError.java index 85fd3fa938d..889c07942ea 100644 --- a/test/hotspot/jtreg/compiler/runtime/TestConstantsInError.java +++ b/test/hotspot/jtreg/compiler/runtime/TestConstantsInError.java @@ -259,7 +259,7 @@ static void run(TestConstantsInError test) throws Exception { c1Args.addAll(List.of("-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-XX:+TracePatching")); c1Args.addAll(commonArgs); - OutputAnalyzer outputC1 = ProcessTools.executeTestJvm(c1Args) + OutputAnalyzer outputC1 = ProcessTools.executeTestJava(c1Args) .shouldHaveExitValue(0); test.process(outputC1, true); @@ -268,7 +268,7 @@ static void run(TestConstantsInError test) throws Exception { c2Args.add("-XX:-TieredCompilation"); c2Args.addAll(commonArgs); - OutputAnalyzer outputC2 = ProcessTools.executeTestJvm(c2Args) + OutputAnalyzer outputC2 = ProcessTools.executeTestJava(c2Args) .shouldHaveExitValue(0); test.process(outputC2, false); diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestVectorErgonomics.java b/test/hotspot/jtreg/compiler/vectorapi/TestVectorErgonomics.java index eb25472370f..99722bc4ce9 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestVectorErgonomics.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestVectorErgonomics.java @@ -37,42 +37,42 @@ public class TestVectorErgonomics { public static void main(String[] args) throws Throwable { - ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", + ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableVectorReboxing", "-Xlog:compilation", "-version") .shouldHaveExitValue(0) .shouldContain("EnableVectorReboxing=true"); - ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", + ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version") .shouldHaveExitValue(0) .shouldContain("EnableVectorAggressiveReboxing=true"); - ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", + ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", "-XX:-EnableVectorReboxing", "-Xlog:compilation", "-version") .shouldHaveExitValue(0) .shouldContain("EnableVectorReboxing=false") .shouldContain("EnableVectorAggressiveReboxing=false"); - ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", + ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", "-XX:-EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version") .shouldHaveExitValue(0) .shouldContain("EnableVectorAggressiveReboxing=false"); - ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", + ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", "-XX:-EnableVectorSupport", "-Xlog:compilation", "-version") .shouldHaveExitValue(0) .shouldContain("EnableVectorSupport=false") .shouldContain("EnableVectorReboxing=false") .shouldContain("EnableVectorAggressiveReboxing=false"); - ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", + ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", "-XX:-EnableVectorSupport", "-XX:+EnableVectorReboxing", "-Xlog:compilation", "-version") .shouldHaveExitValue(0) .shouldContain("EnableVectorSupport=false") .shouldContain("EnableVectorReboxing=false") .shouldContain("EnableVectorAggressiveReboxing=false"); - ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", + ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions", "-XX:-EnableVectorSupport", "-XX:+EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version") .shouldHaveExitValue(0) .shouldContain("EnableVectorSupport=false") diff --git a/test/hotspot/jtreg/gc/arguments/TestSoftMaxHeapSizeFlag.java b/test/hotspot/jtreg/gc/arguments/TestSoftMaxHeapSizeFlag.java index a61e7545522..3d8f31db864 100644 --- a/test/hotspot/jtreg/gc/arguments/TestSoftMaxHeapSizeFlag.java +++ b/test/hotspot/jtreg/gc/arguments/TestSoftMaxHeapSizeFlag.java @@ -42,36 +42,36 @@ public class TestSoftMaxHeapSizeFlag { public static void main(String args[]) throws Exception { // Test default value - ProcessTools.executeTestJvm("-Xms" + Xms, "-Xmx" + Xmx, - "-XX:+PrintFlagsFinal", "-version") + ProcessTools.executeTestJava("-Xms" + Xms, "-Xmx" + Xmx, + "-XX:+PrintFlagsFinal", "-version") .shouldMatch("SoftMaxHeapSize[ ]+=[ ]+" + Xmx) .shouldHaveExitValue(0); // Test setting small value - ProcessTools.executeTestJvm("-Xms" + Xms, "-Xmx" + Xmx, - "-XX:SoftMaxHeapSize=" + Xms, - "-XX:+PrintFlagsFinal", "-version") + ProcessTools.executeTestJava("-Xms" + Xms, "-Xmx" + Xmx, + "-XX:SoftMaxHeapSize=" + Xms, + "-XX:+PrintFlagsFinal", "-version") .shouldMatch("SoftMaxHeapSize[ ]+=[ ]+" + Xms) .shouldHaveExitValue(0); // Test setting middle value - ProcessTools.executeTestJvm("-Xms" + Xms, "-Xmx" + Xmx, - "-XX:SoftMaxHeapSize=" + betweenXmsAndXmx, - "-XX:+PrintFlagsFinal", "-version") + ProcessTools.executeTestJava("-Xms" + Xms, "-Xmx" + Xmx, + "-XX:SoftMaxHeapSize=" + betweenXmsAndXmx, + "-XX:+PrintFlagsFinal", "-version") .shouldMatch("SoftMaxHeapSize[ ]+=[ ]+" + betweenXmsAndXmx) .shouldHaveExitValue(0); // Test setting largest value - ProcessTools.executeTestJvm("-Xms" + Xms, "-Xmx" + Xmx, - "-XX:SoftMaxHeapSize=" + Xmx, - "-XX:+PrintFlagsFinal", "-version") + ProcessTools.executeTestJava("-Xms" + Xms, "-Xmx" + Xmx, + "-XX:SoftMaxHeapSize=" + Xmx, + "-XX:+PrintFlagsFinal", "-version") .shouldMatch("SoftMaxHeapSize[ ]+=[ ]+" + Xmx) .shouldHaveExitValue(0); // Test setting a too large value - ProcessTools.executeTestJvm("-Xms" + Xms, "-Xmx" + Xmx, - "-XX:SoftMaxHeapSize=" + greaterThanXmx, - "-XX:+PrintFlagsFinal", "-version") + ProcessTools.executeTestJava("-Xms" + Xms, "-Xmx" + Xmx, + "-XX:SoftMaxHeapSize=" + greaterThanXmx, + "-XX:+PrintFlagsFinal", "-version") .shouldContain("SoftMaxHeapSize must be less than or equal to the maximum heap size") .shouldHaveExitValue(1); } diff --git a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java index a93232dd82e..a962efba460 100644 --- a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java +++ b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java @@ -129,7 +129,7 @@ private static void runTest(int heapSize, int sleepTime, boolean isIhopAdaptive) } private static OutputAnalyzer executeTest(List options) throws Throwable, RuntimeException { - OutputAnalyzer out = ProcessTools.executeTestJvm(options); + OutputAnalyzer out = ProcessTools.executeTestJava(options); if (out.getExitValue() != 0) { System.out.println(out.getOutput()); throw new RuntimeException("AppIHOP failed with exit code" + out.getExitValue()); diff --git a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java index c84374fa359..7f5259a0855 100644 --- a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java +++ b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java @@ -129,7 +129,7 @@ private static void runTest(int ihop, long pctToFill, long heapSize, boolean exp Collections.addAll(options, COMMON_OPTIONS); options.add(AppIHOP.class.getName()); - OutputAnalyzer out = ProcessTools.executeTestJvm(options); + OutputAnalyzer out = ProcessTools.executeTestJava(options); if (out.getExitValue() != 0) { System.out.println(out.getOutput()); diff --git a/test/hotspot/jtreg/gc/g1/logging/TestG1LoggingFailure.java b/test/hotspot/jtreg/gc/g1/logging/TestG1LoggingFailure.java index 3165cfd53e4..0d6af4ae47a 100644 --- a/test/hotspot/jtreg/gc/g1/logging/TestG1LoggingFailure.java +++ b/test/hotspot/jtreg/gc/g1/logging/TestG1LoggingFailure.java @@ -63,7 +63,7 @@ public static void main(String[] args) throws Throwable { } private static void startVM(List options) throws Throwable, RuntimeException { - OutputAnalyzer out = ProcessTools.executeTestJvm(options); + OutputAnalyzer out = ProcessTools.executeTestJava(options); out.shouldNotContain("pure virtual method called"); diff --git a/test/hotspot/jtreg/gc/g1/plab/TestPLABEvacuationFailure.java b/test/hotspot/jtreg/gc/g1/plab/TestPLABEvacuationFailure.java index 0cebc725261..da22714d950 100644 --- a/test/hotspot/jtreg/gc/g1/plab/TestPLABEvacuationFailure.java +++ b/test/hotspot/jtreg/gc/g1/plab/TestPLABEvacuationFailure.java @@ -108,7 +108,7 @@ private static void runTest(int wastePct, int plabSize, int parGCThreads, int he "-XX:" + (plabIsFixed ? "-" : "+") + "ResizePLAB", "-XX:MaxHeapSize=" + heapSize + "m"); testOptions.add(AppPLABEvacuationFailure.class.getName()); - OutputAnalyzer out = ProcessTools.executeTestJvm(testOptions); + OutputAnalyzer out = ProcessTools.executeTestJava(testOptions); appPlabEvacFailureOutput = out.getOutput(); if (out.getExitValue() != 0) { diff --git a/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java b/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java index 0a9bd24b5f5..95740559cc0 100644 --- a/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java +++ b/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java @@ -116,7 +116,7 @@ public static void main(String[] args) throws Throwable { testCase.print(System.out); List options = PLABUtils.prepareOptions(testCase.toOptions()); options.add(AppPLABPromotion.class.getName()); - OutputAnalyzer out = ProcessTools.executeTestJvm(options); + OutputAnalyzer out = ProcessTools.executeTestJava(options); PLABUtils.commonCheck(out); output = out.getOutput(); checkResults(testCase); diff --git a/test/hotspot/jtreg/gc/g1/plab/TestPLABResize.java b/test/hotspot/jtreg/gc/g1/plab/TestPLABResize.java index 245326ec0bf..48423218868 100644 --- a/test/hotspot/jtreg/gc/g1/plab/TestPLABResize.java +++ b/test/hotspot/jtreg/gc/g1/plab/TestPLABResize.java @@ -87,7 +87,7 @@ public static void main(String[] args) throws Throwable { testCase.print(System.out); List options = PLABUtils.prepareOptions(testCase.toOptions()); options.add(AppPLABResize.class.getName()); - OutputAnalyzer out = ProcessTools.executeTestJvm(options); + OutputAnalyzer out = ProcessTools.executeTestJava(options); PLABUtils.commonCheck(out); checkResults(out.getOutput(), testCase); } diff --git a/test/hotspot/jtreg/gc/stress/gclocker/TestExcessGCLockerCollections.java b/test/hotspot/jtreg/gc/stress/gclocker/TestExcessGCLockerCollections.java index 8b6326b1cae..1e65a80bd3c 100644 --- a/test/hotspot/jtreg/gc/stress/gclocker/TestExcessGCLockerCollections.java +++ b/test/hotspot/jtreg/gc/stress/gclocker/TestExcessGCLockerCollections.java @@ -173,7 +173,7 @@ public static void main(String args[]) throws Exception { finalArgs.addAll(Arrays.asList(args)); // GC and other options obtained from test framework. - OutputAnalyzer output = ProcessTools.executeTestJvm(finalArgs); + OutputAnalyzer output = ProcessTools.executeTestJava(finalArgs); output.shouldHaveExitValue(0); //System.out.println("------------- begin stdout ----------------"); //System.out.println(output.getStdout()); diff --git a/test/hotspot/jtreg/gc/z/TestHighUsage.java b/test/hotspot/jtreg/gc/z/TestHighUsage.java index af24d0b450c..d695c6241a5 100644 --- a/test/hotspot/jtreg/gc/z/TestHighUsage.java +++ b/test/hotspot/jtreg/gc/z/TestHighUsage.java @@ -85,14 +85,14 @@ public static void main(String[] args) throws Exception { } public static void main(String[] args) throws Exception { - ProcessTools.executeTestJvm("-XX:+UseZGC", - "-XX:-ZProactive", - "-Xms128M", - "-Xmx128M", - "-XX:ParallelGCThreads=1", - "-XX:ConcGCThreads=1", - "-Xlog:gc,gc+start", - Test.class.getName()) + ProcessTools.executeTestJava("-XX:+UseZGC", + "-XX:-ZProactive", + "-Xms128M", + "-Xmx128M", + "-XX:ParallelGCThreads=1", + "-XX:ConcGCThreads=1", + "-Xlog:gc,gc+start", + Test.class.getName()) .shouldNotContain("Allocation Stall") .shouldContain("High Usage") .shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/LoadLibrary/TestSunBootLibraryPath.java b/test/hotspot/jtreg/runtime/LoadLibrary/TestSunBootLibraryPath.java index 356064d79a4..deb2a000d3d 100644 --- a/test/hotspot/jtreg/runtime/LoadLibrary/TestSunBootLibraryPath.java +++ b/test/hotspot/jtreg/runtime/LoadLibrary/TestSunBootLibraryPath.java @@ -46,11 +46,11 @@ public static void main(String[] args) throws Exception { // Start a java process with this property set, and check that: // 1) The process failed and // 2) The error message was correct. - ProcessTools.executeTestJvm("-Dsun.boot.library.path=" + tooLongPath, - "TestSunBootLibraryPath", - "'Do-Nothing'") - .shouldNotHaveExitValue(0) - .stdoutShouldContain(expectedErrorMessage); + ProcessTools.executeTestJava("-Dsun.boot.library.path=" + tooLongPath, + "TestSunBootLibraryPath", + "'Do-Nothing'") + .shouldNotHaveExitValue(0) + .stdoutShouldContain(expectedErrorMessage); } else if (!args[0].equals("Do-Nothing")) { // Fail, to prevent accidental args from causing accidental test passing. throw new IllegalArgumentException("Test was launched with an invalid argument."); diff --git a/test/hotspot/jtreg/runtime/Shutdown/ShutdownTest.java b/test/hotspot/jtreg/runtime/Shutdown/ShutdownTest.java index 30b1ebe252a..68dc6b2e1a7 100644 --- a/test/hotspot/jtreg/runtime/Shutdown/ShutdownTest.java +++ b/test/hotspot/jtreg/runtime/Shutdown/ShutdownTest.java @@ -66,7 +66,7 @@ public static void main(String args[]) { private static void startVM(String... options) throws Throwable { // Combine VM flags given from command-line and your additional options - OutputAnalyzer output = ProcessTools.executeTestJvm(options); + OutputAnalyzer output = ProcessTools.executeTestJava(options); output.shouldContain("- ShutdownTest -"); output.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/jni/FindClass/FindClassFromBoot.java b/test/hotspot/jtreg/runtime/jni/FindClass/FindClassFromBoot.java index 06db9c07c73..4f59af310bf 100644 --- a/test/hotspot/jtreg/runtime/jni/FindClass/FindClassFromBoot.java +++ b/test/hotspot/jtreg/runtime/jni/FindClass/FindClassFromBoot.java @@ -42,7 +42,7 @@ public static void main(String... args) throws Exception { Path patches = Paths.get(System.getProperty("test.classes"), "patches", "java.base"); String syspaths = System.getProperty("sun.boot.library.path") + File.pathSeparator + System.getProperty("java.library.path"); - ProcessTools.executeTestJvm("-Dsun.boot.library.path=" + syspaths, + ProcessTools.executeTestJava("-Dsun.boot.library.path=" + syspaths, "--patch-module", "java.base=" + patches.toString(), "BootLoaderTest") .shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/runtime/jni/FindClassUtf8/FindClassUtf8.java b/test/hotspot/jtreg/runtime/jni/FindClassUtf8/FindClassUtf8.java index 4f90838c107..7b0a4cc46bf 100644 --- a/test/hotspot/jtreg/runtime/jni/FindClassUtf8/FindClassUtf8.java +++ b/test/hotspot/jtreg/runtime/jni/FindClassUtf8/FindClassUtf8.java @@ -43,10 +43,10 @@ public final class FindClassUtf8 { public static void main(String... args) throws Exception { if (args.length == 1) { // run java -Xcheck:jni FindClassUtf8 and check that the -Xcheck:jni message comes out. - ProcessTools.executeTestJvm("-Djava.library.path=" + Utils.TEST_NATIVE_PATH, - "-Xcheck:jni", - "-XX:-CreateCoredumpOnCrash", - "FindClassUtf8") + ProcessTools.executeTestJava("-Djava.library.path=" + Utils.TEST_NATIVE_PATH, + "-Xcheck:jni", + "-XX:-CreateCoredumpOnCrash", + "FindClassUtf8") .shouldContain("JNI class name is not a valid UTF8 string") .shouldNotHaveExitValue(0); // you get a core dump from -Xcheck:jni failures } else { diff --git a/test/hotspot/jtreg/runtime/jni/atExit/TestAtExit.java b/test/hotspot/jtreg/runtime/jni/atExit/TestAtExit.java index a54eaedbad4..82d834c869c 100644 --- a/test/hotspot/jtreg/runtime/jni/atExit/TestAtExit.java +++ b/test/hotspot/jtreg/runtime/jni/atExit/TestAtExit.java @@ -61,13 +61,13 @@ public static void main(String[] args) throws Exception { String jlp = "-Djava.library.path=" + Utils.TEST_NATIVE_PATH; // First run will terminate via DestroyJavaVM - OutputAnalyzer output = ProcessTools.executeTestJvm(jlp, main); + OutputAnalyzer output = ProcessTools.executeTestJava(jlp, main); output.shouldNotContain("Unexpected"); output.shouldHaveExitValue(0); output.reportDiagnosticSummary(); // Second run will terminate via System.exit() - output = ProcessTools.executeTestJvm(jlp, main, "doExit"); + output = ProcessTools.executeTestJava(jlp, main, "doExit"); output.shouldNotContain("Unexpected"); output.shouldHaveExitValue(0); output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedEnsureLocalCapacity.java b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedEnsureLocalCapacity.java index 975ac0091c5..ac40fbb4c36 100644 --- a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedEnsureLocalCapacity.java +++ b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedEnsureLocalCapacity.java @@ -65,11 +65,11 @@ public static void main(String[] args) throws Throwable { } // No warning - ProcessTools.executeTestJvm("-Xcheck:jni", - "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, - "TestCheckedEnsureLocalCapacity", - Integer.toString(testArgs[0][0]), - Integer.toString(testArgs[0][1])). + ProcessTools.executeTestJava("-Xcheck:jni", + "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, + "TestCheckedEnsureLocalCapacity", + Integer.toString(testArgs[0][0]), + Integer.toString(testArgs[0][1])). shouldHaveExitValue(0). // check no capacity warning stdoutShouldNotMatch(EXCEED_WARNING). @@ -78,11 +78,11 @@ public static void main(String[] args) throws Throwable { reportDiagnosticSummary(); // Warning - ProcessTools.executeTestJvm("-Xcheck:jni", - "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, - "TestCheckedEnsureLocalCapacity", - Integer.toString(testArgs[1][0]), - Integer.toString(testArgs[1][1])). + ProcessTools.executeTestJava("-Xcheck:jni", + "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, + "TestCheckedEnsureLocalCapacity", + Integer.toString(testArgs[1][0]), + Integer.toString(testArgs[1][1])). shouldHaveExitValue(0). // check for capacity warning stdoutShouldMatch(EXCEED_WARNING). diff --git a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedJniExceptionCheck.java b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedJniExceptionCheck.java index e731bab6374..3c6efeb9a2d 100644 --- a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedJniExceptionCheck.java +++ b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedJniExceptionCheck.java @@ -205,9 +205,9 @@ public static void main(String[] args) throws Throwable { } // launch and check output - checkOuputForCorrectWarnings(ProcessTools.executeTestJvm("-Xcheck:jni", - "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, - "TestCheckedJniExceptionCheck")); + checkOuputForCorrectWarnings(ProcessTools.executeTestJava("-Xcheck:jni", + "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, + "TestCheckedJniExceptionCheck")); } } diff --git a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java index d8bbe0659c2..cff5fc3b6d6 100644 --- a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java +++ b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedReleaseArrayElements.java @@ -44,7 +44,7 @@ public static void main(String[] args) throws Throwable { if (args == null || args.length == 0) { test(); } else { - // Uses executeProcess() instead of executeTestJvm() to avoid passing options + // Uses executeProcess() instead of executeTestJava() to avoid passing options // that might generate output on stderr (which should be empty for this test). ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcheck:jni", diff --git a/test/hotspot/jtreg/runtime/jni/nativeStack/TestNativeStack.java b/test/hotspot/jtreg/runtime/jni/nativeStack/TestNativeStack.java index 36880fe256c..e5e32bedb25 100644 --- a/test/hotspot/jtreg/runtime/jni/nativeStack/TestNativeStack.java +++ b/test/hotspot/jtreg/runtime/jni/nativeStack/TestNativeStack.java @@ -52,19 +52,19 @@ public class TestNativeStack { public static void main(String[] args) throws Throwable { // case 1: Trigger a JNI warning with Xcheck:jni OutputAnalyzer oa = - ProcessTools.executeTestJvm("-Xcheck:jni", - "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, - "TestNativeStack$Main"); + ProcessTools.executeTestJava("-Xcheck:jni", + "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, + "TestNativeStack$Main"); oa.shouldHaveExitValue(0); oa.shouldContain("WARNING in native method"); oa.shouldContain("thread_start"); oa.reportDiagnosticSummary(); // Case 2: Trigger a JNI FatalError call - oa = ProcessTools.executeTestJvm("-XX:-CreateCoredumpOnCrash", - "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, - "TestNativeStack$Main", - "error"); + oa = ProcessTools.executeTestJava("-XX:-CreateCoredumpOnCrash", + "-Djava.library.path=" + Utils.TEST_NATIVE_PATH, + "TestNativeStack$Main", + "error"); oa.shouldNotHaveExitValue(0); oa.shouldContain("FATAL ERROR in native method"); oa.shouldContain("thread_start"); diff --git a/test/hotspot/jtreg/runtime/jni/registerNativesWarning/TestRegisterNativesWarning.java b/test/hotspot/jtreg/runtime/jni/registerNativesWarning/TestRegisterNativesWarning.java index 77aabcc7a01..a377487bcc8 100644 --- a/test/hotspot/jtreg/runtime/jni/registerNativesWarning/TestRegisterNativesWarning.java +++ b/test/hotspot/jtreg/runtime/jni/registerNativesWarning/TestRegisterNativesWarning.java @@ -65,17 +65,17 @@ public static void main(String[] args) throws Exception { String cp = Utils.TEST_CLASS_PATH; String libp = Utils.TEST_NATIVE_PATH; - OutputAnalyzer output = ProcessTools.executeTestJvm("-Djava.library.path=" + libp, - Tester.class.getName()); + OutputAnalyzer output = ProcessTools.executeTestJava("-Djava.library.path=" + libp, + Tester.class.getName()); output.shouldContain(warning); output.shouldHaveExitValue(0); output.reportDiagnosticSummary(); // If we run everything from the "boot" loader there should be no warning - output = ProcessTools.executeTestJvm("-Djava.library.path=" + libp, - "-Xbootclasspath/a:" + cp, - "-Dsun.boot.library.path=" + libp, - Tester.class.getName()); + output = ProcessTools.executeTestJava("-Djava.library.path=" + libp, + "-Xbootclasspath/a:" + cp, + "-Dsun.boot.library.path=" + libp, + Tester.class.getName()); output.shouldNotContain(warning); output.shouldHaveExitValue(0); output.reportDiagnosticSummary(); diff --git a/test/hotspot/jtreg/runtime/stringtable/StringTableCleaningTest.java b/test/hotspot/jtreg/runtime/stringtable/StringTableCleaningTest.java index 10eb3a14ddb..59d8bfbea4f 100644 --- a/test/hotspot/jtreg/runtime/stringtable/StringTableCleaningTest.java +++ b/test/hotspot/jtreg/runtime/stringtable/StringTableCleaningTest.java @@ -58,7 +58,7 @@ public static void main(String[] args) throws Exception { subargs.addAll(List.of("-Xlog:gc,gc+start,stringtable*=trace", "-Xmx1g")); subargs.add(Tester.class.getName()); subargs.addAll(Arrays.asList(args)); - OutputAnalyzer output = ProcessTools.executeTestJvm(subargs); + OutputAnalyzer output = ProcessTools.executeTestJava(subargs); output.shouldHaveExitValue(0); checkOutput(output); } diff --git a/test/hotspot/jtreg/sanity/BasicVMTest.java b/test/hotspot/jtreg/sanity/BasicVMTest.java index a128cdfea37..47773d63df4 100644 --- a/test/hotspot/jtreg/sanity/BasicVMTest.java +++ b/test/hotspot/jtreg/sanity/BasicVMTest.java @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { "-X", "-help"); for (String flag : flags) { - ProcessTools.executeTestJvm(flag) + ProcessTools.executeTestJava(flag) .shouldHaveExitValue(0); } } diff --git a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TestLambdaFormRetransformation.java b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TestLambdaFormRetransformation.java index feacea07aab..48c9ad1328e 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TestLambdaFormRetransformation.java +++ b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TestLambdaFormRetransformation.java @@ -60,7 +60,7 @@ public class TestLambdaFormRetransformation { public static void main(String args[]) throws Throwable { Path agent = TestLambdaFormRetransformation.buildAgent(); - OutputAnalyzer oa = ProcessTools.executeTestJvm("-javaagent:" + + OutputAnalyzer oa = ProcessTools.executeTestJava("-javaagent:" + agent.toAbsolutePath().toString(), "-version"); oa.shouldHaveExitValue(ExitCode.OK.value); } diff --git a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TestRedefineWithUnresolvedClass.java b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TestRedefineWithUnresolvedClass.java index 2e36e33ce83..4bcd2a44588 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TestRedefineWithUnresolvedClass.java +++ b/test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/TestRedefineWithUnresolvedClass.java @@ -79,7 +79,7 @@ private static void buildJar(String jarName) throws Throwable { } private static void launchTest() throws Throwable { - OutputAnalyzer output = ProcessTools.executeTestJvm( + OutputAnalyzer output = ProcessTools.executeTestJava( "-javaagent:" + testClasses + "UnresolvedClassAgent.jar", "-Dtest.classes=" + testClasses, "UnresolvedClassAgent"); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Agent_OnUnload/agentonunload001/TestDriver.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Agent_OnUnload/agentonunload001/TestDriver.java index 9d8bb71cbc5..48245698712 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Agent_OnUnload/agentonunload001/TestDriver.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Agent_OnUnload/agentonunload001/TestDriver.java @@ -53,7 +53,7 @@ public class TestDriver { public static void main(String[] args) throws Exception { - OutputAnalyzer oa = ProcessTools.executeTestJvm( + OutputAnalyzer oa = ProcessTools.executeTestJava( "-agentlib:agentonunload001=-waittime=5", nsk.jvmti.Agent_OnUnload.agentonunload001.class.getName()); oa.shouldHaveExitValue(95); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t.java index 9f028153342..964283d2b01 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t.java @@ -38,13 +38,13 @@ public static void main(String[] args) throws Exception { .skip(3) .collect(Collectors.joining(" ")); - OutputAnalyzer oa = ProcessTools.executeTestJvm( + OutputAnalyzer oa = ProcessTools.executeTestJava( "-agentlib:" + libName + "=-waittime=5 setVerboseMode=yes", className); oa.shouldHaveExitValue(95); oa.stdoutShouldContain(phrase); - oa = ProcessTools.executeTestJvm( + oa = ProcessTools.executeTestJava( "-agentlib:" + libName + "=-waittime=5 setVerboseMode=no", "-verbose:" + verboseType, className); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA02/ma02t001/TestDriver.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA02/ma02t001/TestDriver.java index 2aae25104fe..3d474c4e149 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA02/ma02t001/TestDriver.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA02/ma02t001/TestDriver.java @@ -47,7 +47,7 @@ public class TestDriver { public static void main(String[] args) throws Exception { - OutputAnalyzer oa = ProcessTools.executeTestJvm( + OutputAnalyzer oa = ProcessTools.executeTestJava( "-agentlib:ma02t001=-waittime=5", "-agentlib:ma02t001a=-waittime=5", nsk.jvmti.scenarios.multienv.MA02.ma02t001.class.getName()); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/extcallback/Test.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/extcallback/Test.java index 90cf3cc146b..1d06fb54a9f 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/extcallback/Test.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/extcallback/Test.java @@ -41,7 +41,7 @@ public class Test { public static void main(String[] args) throws Exception { - ProcessTools.executeTestJvm("-agentlib:extcallback", Test1.class.getName()) + ProcessTools.executeTestJava("-agentlib:extcallback", Test1.class.getName()) .shouldHaveExitValue(0) .shouldContain("callbackClassUnload called"); } diff --git a/test/jdk/com/sun/jdi/BadAgentPath.java b/test/jdk/com/sun/jdi/BadAgentPath.java index 68f28701cdc..3ef0adadc84 100644 --- a/test/jdk/com/sun/jdi/BadAgentPath.java +++ b/test/jdk/com/sun/jdi/BadAgentPath.java @@ -38,7 +38,7 @@ public class BadAgentPath { public static void main(String[] args) throws Throwable { - OutputAnalyzer output = ProcessTools.executeTestJvm("-agentpath:/badAgent/agent", "-version"); + OutputAnalyzer output = ProcessTools.executeTestJava("-agentpath:/badAgent/agent", "-version"); output.shouldContain("Could not find agent library /badAgent/agent"); } } diff --git a/test/jdk/com/sun/jdi/DoubleAgentTest.java b/test/jdk/com/sun/jdi/DoubleAgentTest.java index 99ec6091aaf..ea2a109ed9b 100644 --- a/test/jdk/com/sun/jdi/DoubleAgentTest.java +++ b/test/jdk/com/sun/jdi/DoubleAgentTest.java @@ -44,7 +44,7 @@ public static void main(String[] args) throws Throwable { String jdwpOption = "-agentlib:jdwp=transport=dt_socket" + ",server=y" + ",suspend=n" + ",address=*:0"; - OutputAnalyzer output = ProcessTools.executeTestJvm("-classpath", + OutputAnalyzer output = ProcessTools.executeTestJava("-classpath", TEST_CLASSES, jdwpOption, // Notice jdwpOption specified twice jdwpOption, diff --git a/test/jdk/com/sun/jdi/OnJcmdTest.java b/test/jdk/com/sun/jdi/OnJcmdTest.java index 6cc417497c6..c7f93e6fb31 100644 --- a/test/jdk/com/sun/jdi/OnJcmdTest.java +++ b/test/jdk/com/sun/jdi/OnJcmdTest.java @@ -51,12 +51,12 @@ private static String getListenerAddress() throws Exception { public static void main(String[] args) throws Throwable { // First check if we get the expected errors. - OutputAnalyzer output = ProcessTools.executeTestJvm( + OutputAnalyzer output = ProcessTools.executeTestJava( "-agentlib:jdwp=transport=dt_socket,address=any,onjcmd=y"); output.shouldContain("Can only use onjcmd with server=y"); output.shouldHaveExitValue(1); - output = ProcessTools.executeTestJvm( + output = ProcessTools.executeTestJava( "-agentlib:jdwp=transport=dt_socket,address=any,onjcmd=y,onthrow=a,launch=a"); output.shouldContain("Cannot combine onjcmd and launch suboptions"); output.shouldHaveExitValue(1); diff --git a/test/jdk/com/sun/jdi/SuspendNoFlagTest.java b/test/jdk/com/sun/jdi/SuspendNoFlagTest.java index 98b32063c74..31e717a63d0 100644 --- a/test/jdk/com/sun/jdi/SuspendNoFlagTest.java +++ b/test/jdk/com/sun/jdi/SuspendNoFlagTest.java @@ -38,7 +38,7 @@ public class SuspendNoFlagTest { "test.classes", "."); public static void main(String[] args) throws Throwable { - OutputAnalyzer output = ProcessTools.executeTestJvm("-classpath", + OutputAnalyzer output = ProcessTools.executeTestJava("-classpath", TEST_CLASSES, "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n", "HelloWorld"); diff --git a/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java b/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java index 73e53da63f1..5e2b86ceacb 100644 --- a/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java +++ b/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java @@ -45,7 +45,7 @@ public class DcmdMBeanTestCheckJni { public static void main(String[] args) throws Exception { - OutputAnalyzer out = ProcessTools.executeTestJvm( + OutputAnalyzer out = ProcessTools.executeTestJava( "-Xcheck:jni", DcmdMBeanRunner.class.getName()); out.shouldNotMatch("WARNING: JNI local refs: \\d+, exceeds capacity: \\d+\\s+" + diff --git a/test/jdk/com/sun/tools/attach/BasicTests.java b/test/jdk/com/sun/tools/attach/BasicTests.java index 6002dc2115b..4dc7065630f 100644 --- a/test/jdk/com/sun/tools/attach/BasicTests.java +++ b/test/jdk/com/sun/tools/attach/BasicTests.java @@ -101,7 +101,7 @@ private static void runTests(long pid) throws Throwable { testClassDir + "Agent.jar", testClassDir + "BadAgent.jar", testClassDir + "RedefineAgent.jar" }; - OutputAnalyzer output = ProcessTools.executeTestJvm(args); + OutputAnalyzer output = ProcessTools.executeTestJava(args); output.shouldHaveExitValue(0); } diff --git a/test/jdk/com/sun/tools/attach/PermissionTest.java b/test/jdk/com/sun/tools/attach/PermissionTest.java index 3a4128a9472..bf9473b0c8c 100644 --- a/test/jdk/com/sun/tools/attach/PermissionTest.java +++ b/test/jdk/com/sun/tools/attach/PermissionTest.java @@ -86,7 +86,7 @@ private static void runTests(long pid) throws Throwable { "PermissionTest$TestMain", Long.toString(pid), "true" }; - OutputAnalyzer output = ProcessTools.executeTestJvm(args); + OutputAnalyzer output = ProcessTools.executeTestJava(args); output.shouldHaveExitValue(0); // Use a policy that will allow attach. @@ -98,7 +98,7 @@ private static void runTests(long pid) throws Throwable { "PermissionTest$TestMain", Long.toString(pid), "false" }; - output = ProcessTools.executeTestJvm(args); + output = ProcessTools.executeTestJava(args); output.shouldHaveExitValue(0); } diff --git a/test/jdk/com/sun/tools/attach/ProviderTest.java b/test/jdk/com/sun/tools/attach/ProviderTest.java index 575420722d3..c7249a54b26 100644 --- a/test/jdk/com/sun/tools/attach/ProviderTest.java +++ b/test/jdk/com/sun/tools/attach/ProviderTest.java @@ -79,7 +79,7 @@ private static void runTests() throws Throwable { "-classpath", classpath, "ProviderTest$TestMain" }; - OutputAnalyzer output = ProcessTools.executeTestJvm(args); + OutputAnalyzer output = ProcessTools.executeTestJava(args); output.shouldHaveExitValue(0); } diff --git a/test/jdk/com/sun/tools/attach/TempDirTest.java b/test/jdk/com/sun/tools/attach/TempDirTest.java index 2d932ffcf0e..b9ce4acb141 100644 --- a/test/jdk/com/sun/tools/attach/TempDirTest.java +++ b/test/jdk/com/sun/tools/attach/TempDirTest.java @@ -140,7 +140,7 @@ private static void launchTests(long pid, Path clientTmpDir) throws Throwable { classpath, "TempDirTest$TestMain", Long.toString(pid) }); - OutputAnalyzer output = ProcessTools.executeTestJvm(args); + OutputAnalyzer output = ProcessTools.executeTestJava(args); output.shouldHaveExitValue(0); } diff --git a/test/jdk/java/io/FilePermission/MergeName.java b/test/jdk/java/io/FilePermission/MergeName.java index c2eff765f2d..715b9851209 100644 --- a/test/jdk/java/io/FilePermission/MergeName.java +++ b/test/jdk/java/io/FilePermission/MergeName.java @@ -81,7 +81,7 @@ private static void test(String file, String... actions) throws Exception { } content.add("};"); Files.write(Paths.get(file), content); - ProcessTools.executeTestJvm("-Djava.security.manager", + ProcessTools.executeTestJava("-Djava.security.manager", "-Djava.security.policy=" + file, "MergeName", "x", diff --git a/test/jdk/java/io/FilePermission/ReadFileOnPath.java b/test/jdk/java/io/FilePermission/ReadFileOnPath.java index acc66dac6ab..06e2c6c435a 100644 --- a/test/jdk/java/io/FilePermission/ReadFileOnPath.java +++ b/test/jdk/java/io/FilePermission/ReadFileOnPath.java @@ -87,7 +87,7 @@ static void test(String... args) throws Exception { cmds.addAll(List.of( "x", "modules/m", "modules/m/base", "modules/m/p/child", "-", "child", "/base", "../base")); - ProcessTools.executeTestJvm(cmds.toArray(new String[cmds.size()])) + ProcessTools.executeTestJava(cmds.toArray(new String[cmds.size()])) .shouldHaveExitValue(0); } } diff --git a/test/jdk/java/lang/ClassLoader/securityManager/ClassLoaderTest.java b/test/jdk/java/lang/ClassLoader/securityManager/ClassLoaderTest.java index efb243bde97..298285ac5ae 100644 --- a/test/jdk/java/lang/ClassLoader/securityManager/ClassLoaderTest.java +++ b/test/jdk/java/lang/ClassLoader/securityManager/ClassLoaderTest.java @@ -237,7 +237,7 @@ private void execute(String[] args, String status, String msg) throws Exception if (s.contains(" ")) { throw new RuntimeException("No spaces in args");} return !s.isEmpty(); }).toArray(String[]::new); - String out = ProcessTools.executeTestJvm(safeArgs).getOutput(); + String out = ProcessTools.executeTestJava(safeArgs).getOutput(); // Handle response. if ("PASS".equals(status) && out.contains(msg)) { System.out.println("PASS: Expected Result: " + msg); diff --git a/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownHooks.java b/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownHooks.java index 6b2dc7b4dbf..36d3878fb41 100644 --- a/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownHooks.java +++ b/test/jdk/java/lang/RuntimeTests/shutdown/ShutdownHooks.java @@ -61,7 +61,7 @@ public void testShutdownHooks() throws Exception { // Run in a new process in order to evaluate shutdown hook results String[] testCommand = new String[] {"-classpath", TEST_CLASSES, ShutdownHooksProcess.class.getName()}; - ProcessTools.executeTestJvm(testCommand).shouldHaveExitValue(0); + ProcessTools.executeTestJava(testCommand).shouldHaveExitValue(0); String errorMsg = "File exists despite shutdown hook has been run"; assertFalse(Files.exists(TEST_FILE.toPath()), errorMsg); diff --git a/test/jdk/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java b/test/jdk/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java index 8fdd7878639..fdbe44fb03c 100644 --- a/test/jdk/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java +++ b/test/jdk/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java @@ -94,7 +94,7 @@ public static void main(String args[]) throws Throwable { "-Djava.security.manager", "-Djava.security.policy=" + POL, "ExtensiblePolicyTest_orig$TestMain"}; - ProcessTools.executeTestJvm(cmd).shouldHaveExitValue(0); + ProcessTools.executeTestJava(cmd).shouldHaveExitValue(0); } catch (Exception ex) { System.out.println("ExtensiblePolicyWithJarTest Failed"); } diff --git a/test/jdk/java/security/Policy/SignedJar/SignedJarTest.java b/test/jdk/java/security/Policy/SignedJar/SignedJarTest.java index c93337d73d0..cd06cc15691 100644 --- a/test/jdk/java/security/Policy/SignedJar/SignedJarTest.java +++ b/test/jdk/java/security/Policy/SignedJar/SignedJarTest.java @@ -121,7 +121,7 @@ public static void main(String args[]) throws Throwable { System.out.println("Test Case 1"); //copy policy file into current directory String[] cmd = constructCMD("first.jar", POLICY1, "false", "true"); - ProcessTools.executeTestJvm(cmd).shouldHaveExitValue(0); + ProcessTools.executeTestJava(cmd).shouldHaveExitValue(0); //test case 2, test with both.jar //setIO permission granted to code that was signed by first signer @@ -131,7 +131,7 @@ public static void main(String args[]) throws Throwable { //Expect no AccessControlException System.out.println("Test Case 2"); cmd = constructCMD("both.jar", POLICY1, "false", "false"); - ProcessTools.executeTestJvm(cmd).shouldHaveExitValue(0); + ProcessTools.executeTestJava(cmd).shouldHaveExitValue(0); //test case 3 //setIO permission granted to code that was signed by first signer @@ -141,7 +141,7 @@ public static void main(String args[]) throws Throwable { //Expect AccessControlException for setFactory permission System.out.println("Test Case 3"); cmd = constructCMD("both.jar", POLICY2, "false", "true"); - ProcessTools.executeTestJvm(cmd).shouldHaveExitValue(0); + ProcessTools.executeTestJava(cmd).shouldHaveExitValue(0); } diff --git a/test/jdk/java/security/Provider/SecurityProviderModularTest.java b/test/jdk/java/security/Provider/SecurityProviderModularTest.java index 560331e3ada..7c08f3faf6b 100644 --- a/test/jdk/java/security/Provider/SecurityProviderModularTest.java +++ b/test/jdk/java/security/Provider/SecurityProviderModularTest.java @@ -253,7 +253,7 @@ private void execute(String args, String msgKey) throws Exception { } return !s.isEmpty(); }).toArray(String[]::new); - String out = ProcessTools.executeTestJvm(safeArgs).getOutput(); + String out = ProcessTools.executeTestJava(safeArgs).getOutput(); // Handle response. if ((msgKey != null && out.contains(MSG_MAP.get(msgKey)))) { System.out.printf("PASS: Expected Result: %s.%n", diff --git a/test/jdk/java/security/Security/signedfirst/DynStatic.java b/test/jdk/java/security/Security/signedfirst/DynStatic.java index 5256564064b..59e30de5462 100644 --- a/test/jdk/java/security/Security/signedfirst/DynStatic.java +++ b/test/jdk/java/security/Security/signedfirst/DynStatic.java @@ -78,7 +78,7 @@ public static void main(String[] args) throws Exception { CompilerUtils.compile(DYN_SRC, TEST_CLASSES, "-classpath", "exp.jar"); // Run the DynSignedProvFirst test program - ProcessTools.executeTestJvm("-classpath", + ProcessTools.executeTestJava("-classpath", TEST_CLASSES.toString() + File.pathSeparator + "exp.jar", "DynSignedProvFirst") .shouldContain("test passed"); @@ -87,7 +87,7 @@ public static void main(String[] args) throws Exception { CompilerUtils.compile(STATIC_SRC, TEST_CLASSES, "-classpath", "exp.jar"); // Run the StaticSignedProvFirst test program - ProcessTools.executeTestJvm("-classpath", + ProcessTools.executeTestJava("-classpath", TEST_CLASSES.toString() + File.pathSeparator + "exp.jar", "-Djava.security.properties=file:" + STATIC_PROPS, "StaticSignedProvFirst") diff --git a/test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java b/test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java index 69fe8effe70..83c2d85f6e4 100644 --- a/test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java +++ b/test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java @@ -100,7 +100,7 @@ public static void main(String[] args) throws Throwable { testRun.add(classPath); testRun.add(TestSPISigned.class.getSimpleName()); testRun.add("run-test"); - OutputAnalyzer out = ProcessTools.executeTestJvm(testRun); + OutputAnalyzer out = ProcessTools.executeTestJava(testRun); out.shouldHaveExitValue(0); out.shouldContain("DEBUG: Getting xx language"); } diff --git a/test/jdk/java/util/Currency/PropertiesTestRun.java b/test/jdk/java/util/Currency/PropertiesTestRun.java index 6f2ea28a90d..baec22f3e86 100644 --- a/test/jdk/java/util/Currency/PropertiesTestRun.java +++ b/test/jdk/java/util/Currency/PropertiesTestRun.java @@ -116,7 +116,7 @@ private static Stream PropertiesTestMethods() { // Launch a PropertiesTest method using the TEST JDK private static void executeTestJDKMethod(String... params) throws Throwable { - int exitStatus = ProcessTools.executeTestJvm(params).getExitValue(); + int exitStatus = ProcessTools.executeTestJava(params).getExitValue(); if (exitStatus != 0) { fail("Process started with: " + Arrays.toString(params) + " failed"); } @@ -126,7 +126,7 @@ private static void executeTestJDKMethod(String... params) throws Throwable { private static void executeWritableJDKMethod(String... params) throws Throwable { // Need to include WritableJDK javapath, TEST JDK classpath String[] allParams = new String[3+params.length+Utils.getTestJavaOpts().length]; - // We don't use executeTestJvm() because we want to point to separate JDK java path + // We don't use executeTestJava() because we want to point to separate JDK java path allParams[0] = WRITABLE_JDK_JAVA_PATH; allParams[1] = "-cp"; allParams[2] = System.getProperty("java.class.path"); diff --git a/test/jdk/java/util/Locale/UseOldISOCodesTest.java b/test/jdk/java/util/Locale/UseOldISOCodesTest.java index 38008e9f662..d4f7b53f0c6 100644 --- a/test/jdk/java/util/Locale/UseOldISOCodesTest.java +++ b/test/jdk/java/util/Locale/UseOldISOCodesTest.java @@ -41,7 +41,7 @@ public class UseOldISOCodesTest { // Ensure java.locale.useOldISOCodes is only interpreted at runtime startup @Test public void staticInitializationTest() throws Exception { - ProcessTools.executeTestJvm("-Djava.locale.useOldISOCodes=true", "UseOldISOCodesTest$Runner") + ProcessTools.executeTestJava("-Djava.locale.useOldISOCodes=true", "UseOldISOCodesTest$Runner") .outputTo(System.out) .errorTo(System.err) .shouldHaveExitValue(0); diff --git a/test/jdk/java/util/prefs/CheckUserPrefsStorage.java b/test/jdk/java/util/prefs/CheckUserPrefsStorage.java index 51ecae932d1..1f772f4811a 100644 --- a/test/jdk/java/util/prefs/CheckUserPrefsStorage.java +++ b/test/jdk/java/util/prefs/CheckUserPrefsStorage.java @@ -42,7 +42,7 @@ public static void main(String[] args) throws Throwable { } public static void run(String testName) throws Exception { - ProcessTools.executeTestJvm("-Djava.util.prefs.userRoot=.", testName) + ProcessTools.executeTestJava("-Djava.util.prefs.userRoot=.", testName) .outputTo(System.out) .errorTo(System.out) .shouldHaveExitValue(0); diff --git a/test/jdk/java/util/zip/EntryCount64k.java b/test/jdk/java/util/zip/EntryCount64k.java index 08d896a124a..2dac7643de2 100644 --- a/test/jdk/java/util/zip/EntryCount64k.java +++ b/test/jdk/java/util/zip/EntryCount64k.java @@ -160,7 +160,7 @@ static void checkCanRead(File zipFile, int entryCount) throws Throwable { } // Check java -jar - OutputAnalyzer a = ProcessTools.executeTestJvm("-jar", zipFile.getName()); + OutputAnalyzer a = ProcessTools.executeTestJava("-jar", zipFile.getName()); a.shouldHaveExitValue(0); a.stdoutShouldMatch("\\AMain\\Z"); a.stderrShouldMatch("\\A\\Z"); diff --git a/test/jdk/java/util/zip/ZipFile/DeleteTempJarTest.java b/test/jdk/java/util/zip/ZipFile/DeleteTempJarTest.java index e0a987f8bdc..cafc17accf8 100644 --- a/test/jdk/java/util/zip/ZipFile/DeleteTempJarTest.java +++ b/test/jdk/java/util/zip/ZipFile/DeleteTempJarTest.java @@ -42,7 +42,7 @@ public class DeleteTempJarTest { public static void main(String[] args) throws Exception { - String tmpFile = ProcessTools.executeTestJvm(DeleteTempJar.class.getName()) + String tmpFile = ProcessTools.executeTestJava(DeleteTempJar.class.getName()) .shouldHaveExitValue(0) .getStdout(); diff --git a/test/jdk/javax/security/auth/login/modules/JaasModularClientTest.java b/test/jdk/javax/security/auth/login/modules/JaasModularClientTest.java index 987c0e2e66a..c4bb44db3ad 100644 --- a/test/jdk/javax/security/auth/login/modules/JaasModularClientTest.java +++ b/test/jdk/javax/security/auth/login/modules/JaasModularClientTest.java @@ -183,7 +183,7 @@ private void execute(String args) throws Exception { } return !s.isEmpty(); }).toArray(String[]::new); - OutputAnalyzer out = ProcessTools.executeTestJvm(safeArgs); + OutputAnalyzer out = ProcessTools.executeTestJava(safeArgs); // Handle response. if (out.getExitValue() != 0) { System.out.printf("OUTPUT: %s", out.getOutput()); diff --git a/test/jdk/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java b/test/jdk/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java index 5752c4e3c5d..faab81afb0d 100644 --- a/test/jdk/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java +++ b/test/jdk/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java @@ -167,7 +167,7 @@ private void execute(String args) throws Exception { } return !s.isEmpty(); }).toArray(String[]::new); - OutputAnalyzer out = ProcessTools.executeTestJvm(safeArgs); + OutputAnalyzer out = ProcessTools.executeTestJava(safeArgs); // Handle response. if (out.getExitValue() != 0) { System.out.printf("OUTPUT: %s", out.getOutput()); diff --git a/test/jdk/jdk/internal/ref/Cleaner/ExitOnThrow.java b/test/jdk/jdk/internal/ref/Cleaner/ExitOnThrow.java index 02346414cd3..7651c92bf77 100644 --- a/test/jdk/jdk/internal/ref/Cleaner/ExitOnThrow.java +++ b/test/jdk/jdk/internal/ref/Cleaner/ExitOnThrow.java @@ -44,9 +44,9 @@ public class ExitOnThrow { public static void main(String[] args) throws Exception { if (args.length == 0) { - ProcessTools.executeTestJvm("--add-exports", "java.base/jdk.internal.ref=ALL-UNNAMED", - "ExitOnThrow", - "-executeCleaner") + ProcessTools.executeTestJava("--add-exports", "java.base/jdk.internal.ref=ALL-UNNAMED", + "ExitOnThrow", + "-executeCleaner") .outputTo(System.out) .errorTo(System.out) .shouldHaveExitValue(1) diff --git a/test/jdk/jdk/jfr/api/consumer/security/TestStreamingRemote.java b/test/jdk/jdk/jfr/api/consumer/security/TestStreamingRemote.java index 6b97613f4ab..f5a32e0b45a 100644 --- a/test/jdk/jdk/jfr/api/consumer/security/TestStreamingRemote.java +++ b/test/jdk/jdk/jfr/api/consumer/security/TestStreamingRemote.java @@ -81,7 +81,7 @@ public static void main(String... args) throws Exception { c[1] = "-Djava.security.policy=" + escapeBackslashes(policy.toString()); c[2] = Test.class.getName(); c[3] = repository; - OutputAnalyzer oa = ProcessTools.executeTestJvm(c); + OutputAnalyzer oa = ProcessTools.executeTestJava(c); oa.shouldContain(SUCCESS); } } diff --git a/test/jdk/jdk/jfr/event/io/TestInstrumentation.java b/test/jdk/jdk/jfr/event/io/TestInstrumentation.java index 5e08f45cb55..ddbc1206497 100644 --- a/test/jdk/jdk/jfr/event/io/TestInstrumentation.java +++ b/test/jdk/jdk/jfr/event/io/TestInstrumentation.java @@ -283,7 +283,7 @@ private static void launchTest() throws Throwable { "-classpath", classpath, "-javaagent:" + testClassDir + "TestInstrumentation.jar", "jdk.jfr.event.io.TestInstrumentation$TestMain" }; - OutputAnalyzer output = ProcessTools.executeTestJvm(args); + OutputAnalyzer output = ProcessTools.executeTestJava(args); output.shouldHaveExitValue(0); } diff --git a/test/jdk/sun/security/pkcs11/Config/ReadConfInUTF16Env.java b/test/jdk/sun/security/pkcs11/Config/ReadConfInUTF16Env.java index b5ca601c011..11a6a781e01 100644 --- a/test/jdk/sun/security/pkcs11/Config/ReadConfInUTF16Env.java +++ b/test/jdk/sun/security/pkcs11/Config/ReadConfInUTF16Env.java @@ -40,7 +40,7 @@ public class ReadConfInUTF16Env { public void testReadConfInUTF16Env() throws Exception { String[] testCommand = new String[] { "-Dfile.encoding=UTF-16", TestSunPKCS11Provider.class.getName()}; - ProcessTools.executeTestJvm(testCommand).shouldHaveExitValue(0); + ProcessTools.executeTestJava(testCommand).shouldHaveExitValue(0); } static class TestSunPKCS11Provider { diff --git a/test/jdk/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java b/test/jdk/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java index b9fb72b8faf..476dc954884 100644 --- a/test/jdk/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java +++ b/test/jdk/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java @@ -231,7 +231,7 @@ static void testConstraint(String[] trustNames, String[] certNames, // Run client on another JVM so that its properties cannot be in conflict // with server's. - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava( "-Dcert.dir=" + CERT_DIR, "-Djava.security.debug=certpath", "-classpath", diff --git a/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java b/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java index 1ce50662f46..7632fcf462f 100644 --- a/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java +++ b/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.java @@ -93,7 +93,7 @@ public class DebugReportsOneExtraByte extends SSLEngineTemplate { public static void main(String args[]) throws Exception { if (args.length == 0) { - OutputAnalyzer output = ProcessTools.executeTestJvm( + OutputAnalyzer output = ProcessTools.executeTestJava( "-Dtest.src=" + System.getProperty("test.src"), "-Djavax.net.debug=all", "DebugReportsOneExtraByte", "p"); output.shouldContain("WRITE: TLSv1 application_data, length = 8"); diff --git a/test/jdk/sun/security/ssl/SSLLogger/LoggingFormatConsistency.java b/test/jdk/sun/security/ssl/SSLLogger/LoggingFormatConsistency.java index c614ca62f29..5cfa9c9a680 100644 --- a/test/jdk/sun/security/ssl/SSLLogger/LoggingFormatConsistency.java +++ b/test/jdk/sun/security/ssl/SSLLogger/LoggingFormatConsistency.java @@ -50,7 +50,7 @@ public class LoggingFormatConsistency extends SSLSocketTemplate { public static void main(String[] args) throws Exception { if (args.length != 0) { // A non-empty set of arguments occurs when the "runTest" argument - // is passed to the test via ProcessTools::executeTestJvm. + // is passed to the test via ProcessTools::executeTestJava. // // This is done because an OutputAnalyzer is unable to read // the output of the current running JVM, and must therefore create @@ -71,7 +71,7 @@ public static void main(String[] args) throws Exception { System.out.println("TESTING " + expectedTLSVersion); var activeTLSProtocol = "-Djdk.tls.client.protocols=" + expectedTLSVersion; - var output = ProcessTools.executeTestJvm( + var output = ProcessTools.executeTestJava( testSrc, activeTLSProtocol, javaxNetDebug, diff --git a/test/jdk/sun/security/ssl/SSLSocketImpl/IgnorableExceptionMessages.java b/test/jdk/sun/security/ssl/SSLSocketImpl/IgnorableExceptionMessages.java index 708b8f0d11b..a1c9cad2271 100644 --- a/test/jdk/sun/security/ssl/SSLSocketImpl/IgnorableExceptionMessages.java +++ b/test/jdk/sun/security/ssl/SSLSocketImpl/IgnorableExceptionMessages.java @@ -49,7 +49,7 @@ public class IgnorableExceptionMessages extends SSLSocketTemplate { public static void main(String[] args) throws Exception { if (args.length > 0) { // A non-empty set of arguments occurs when the "runTest" argument - // is passed to the test via ProcessTools::executeTestJvm. + // is passed to the test via ProcessTools::executeTestJava. // // This is done because an OutputAnalyzer is unable to read // the output of the current running JVM, and must therefore create @@ -67,7 +67,7 @@ public static void main(String[] args) throws Exception { className, extraArgument); - OutputAnalyzer output = ProcessTools.executeTestJvm(jvmArgs); + OutputAnalyzer output = ProcessTools.executeTestJava(jvmArgs); if (output.getExitValue() != 0) { output.asLines().forEach(System.out::println); // No need to dump the output unless the test fails diff --git a/test/jdk/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java b/test/jdk/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java index ccc4b405147..9c9a8590ac7 100644 --- a/test/jdk/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java +++ b/test/jdk/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java @@ -120,7 +120,7 @@ public static void main(String[] args) throws Throwable { "-Djava.security.policy=" + TEST_SRC + File.separator + POLICY_FILE, "version.Main"}; - ProcessTools.executeTestJvm(cmd) + ProcessTools.executeTestJava(cmd) .shouldHaveExitValue(0) .shouldContain(VERSION_MESSAGE); } diff --git a/test/jdk/sun/security/util/Resources/early/EarlyResources.java b/test/jdk/sun/security/util/Resources/early/EarlyResources.java index 12da50e311f..3ee0a9f576c 100644 --- a/test/jdk/sun/security/util/Resources/early/EarlyResources.java +++ b/test/jdk/sun/security/util/Resources/early/EarlyResources.java @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { String fs = File.separator; String policyPath = testSrc + fs + "malformed.policy"; - OutputAnalyzer out = ProcessTools.executeTestJvm( + OutputAnalyzer out = ProcessTools.executeTestJava( "-Djava.security.manager", "-Djava.security.policy=" + policyPath, "EarlyResources$TestMain"); diff --git a/test/lib-test/jdk/test/lib/RandomGeneratorTest.java b/test/lib-test/jdk/test/lib/RandomGeneratorTest.java index ce57ebfe65f..71e36bdc9c4 100644 --- a/test/lib-test/jdk/test/lib/RandomGeneratorTest.java +++ b/test/lib-test/jdk/test/lib/RandomGeneratorTest.java @@ -69,7 +69,7 @@ public static void main( String[] args) throws Throwable { jvmArgs.add(origFileName); int fileNameIndex = jvmArgs.size() - 1; String[] cmdLineArgs = jvmArgs.toArray(new String[jvmArgs.size()]); - ProcessTools.executeTestJvm(cmdLineArgs).shouldHaveExitValue(0); + ProcessTools.executeTestJava(cmdLineArgs).shouldHaveExitValue(0); String etalon = Utils.fileAsString(origFileName).trim(); cmdLineArgs[fileNameIndex] = seedOpt.name(); seedOpt.verify(etalon, cmdLineArgs); @@ -143,7 +143,7 @@ public void verify(String orig, String[] cmdLine) { String output; OutputAnalyzer oa; try { - oa = ProcessTools.executeTestJvm(cmdLine); + oa = ProcessTools.executeTestJava(cmdLine); } catch (Throwable t) { throw new Error("TESTBUG: Unexpedted exception during jvm execution.", t); } diff --git a/test/lib-test/jdk/test/lib/process/ProcessToolsExecuteLimitedTestJavaTest.java b/test/lib-test/jdk/test/lib/process/ProcessToolsExecuteLimitedTestJavaTest.java new file mode 100644 index 00000000000..4331f9ab374 --- /dev/null +++ b/test/lib-test/jdk/test/lib/process/ProcessToolsExecuteLimitedTestJavaTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Unit test for ProcessTools.executeLimitedTestJava() + * @library /test/lib + * @run main/othervm -Dtest.java.opts=-XX:MaxMetaspaceSize=123456789 ProcessToolsExecuteLimitedTestJavaTest + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class ProcessToolsExecuteLimitedTestJavaTest { + public static void main(String[] args) throws Exception { + if (args.length > 0) { + // Do nothing. Just let the JVM log its output. + } else { + // In comparison to executeTestJava, executeLimitedTestJava should not add the + // -Dtest.java.opts flags. Check that it doesn't. + OutputAnalyzer output = ProcessTools.executeLimitedTestJava("-XX:+PrintFlagsFinal", "-version"); + output.stdoutShouldNotMatch(".*MaxMetaspaceSize.* = 123456789.*"); + } + } +} diff --git a/test/lib/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java index cad9d9ecd57..c508af1036e 100644 --- a/test/lib/jdk/test/lib/process/ProcessTools.java +++ b/test/lib/jdk/test/lib/process/ProcessTools.java @@ -517,43 +517,69 @@ public static ProcessBuilder createLimitedTestJavaProcessBuilder(String... comma } /** - * Executes a test jvm process, waits for it to finish and returns + * Executes a process using the java launcher from the jdk to + * be tested, waits for it to finish and returns * the process output. * *

The process is created using runtime flags set up by: * {@link #createTestJavaProcessBuilder(String...)}. The * jvm process will have exited before this method returns. * - * @param cmds User specified arguments. + * @param command User specified arguments. * @return The output from the process. */ - public static OutputAnalyzer executeTestJvm(List cmds) throws Exception { - return executeTestJvm(cmds.toArray(String[]::new)); + public static OutputAnalyzer executeTestJava(List command) throws Exception { + return executeTestJava(command.toArray(String[]::new)); } /** - * Executes a test jvm process, waits for it to finish and returns + * Executes a process using the java launcher from the jdk to + * be tested, waits for it to finish and returns * the process output. * *

The process is created using runtime flags set up by: * {@link #createTestJavaProcessBuilder(String...)}. The * jvm process will have exited before this method returns. * - * @param cmds User specified arguments. + * @param command User specified arguments. * @return The output from the process. */ - public static OutputAnalyzer executeTestJvm(String... cmds) throws Exception { - ProcessBuilder pb = createTestJavaProcessBuilder(cmds); + public static OutputAnalyzer executeTestJava(String... command) throws Exception { + ProcessBuilder pb = createTestJavaProcessBuilder(command); return executeProcess(pb); } /** - * @param cmds User specified arguments. + * Executes a process using the java launcher from the jdk to + * be tested, waits for it to finish and returns + * the process output. + * + *

The process is created using runtime flags set up by: + * {@link #createLimitedTestJavaProcessBuilder(String...)}. The + * jvm process will have exited before this method returns. + * + * @param command User specified arguments. + * @return The output from the process. + */ + public static OutputAnalyzer executeLimitedTestJava(List command) throws Exception { + return executeLimitedTestJava(command.toArray(String[]::new)); + } + + /** + * Executes a process using the java launcher from the jdk to + * be tested, waits for it to finish and returns + * the process output. + * + *

The process is created using runtime flags set up by: + * {@link #createLimitedTestJavaProcessBuilder(String...)}. The + * jvm process will have exited before this method returns. + * + * @param command User specified arguments. * @return The output from the process. - * @see #executeTestJvm(String...) */ - public static OutputAnalyzer executeTestJava(String... cmds) throws Exception { - return executeTestJvm(cmds); + public static OutputAnalyzer executeLimitedTestJava(String... command) throws Exception { + ProcessBuilder pb = createLimitedTestJavaProcessBuilder(command); + return executeProcess(pb); } /**