Skip to content

Commit 1d1cd32

Browse files
committed
8321812: Update GC tests to use execute[Limited]TestJava
Reviewed-by: tschatzl, aboldtch
1 parent 868f874 commit 1d1cd32

File tree

132 files changed

+478
-671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+478
-671
lines changed

test/hotspot/jtreg/gc/TestAgeOutput.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static void checkPattern(String pattern, String what) throws Exception {
6666
}
6767

6868
public static void runTest(String gcArg) throws Exception {
69-
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
69+
OutputAnalyzer output = ProcessTools.executeLimitedTestJava(
7070
"-Xbootclasspath/a:.",
7171
"-XX:+UnlockExperimentalVMOptions",
7272
"-XX:+UnlockDiagnosticVMOptions",
@@ -75,7 +75,6 @@ public static void runTest(String gcArg) throws Exception {
7575
"-Xmx10M",
7676
"-Xlog:gc+age=trace",
7777
GCTest.class.getName());
78-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
7978

8079
output.shouldHaveExitValue(0);
8180

test/hotspot/jtreg/gc/TestAllocateHeapAt.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@
3636

3737
public class TestAllocateHeapAt {
3838
public static void main(String args[]) throws Exception {
39-
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
39+
OutputAnalyzer output = ProcessTools.executeTestJava(
4040
"-XX:AllocateHeapAt=" + System.getProperty("test.dir", "."),
4141
"-Xlog:gc+heap=info",
4242
"-Xmx32m",
4343
"-Xms32m",
4444
"-version");
45-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
4645

4746
System.out.println("Output:\n" + output.getOutput());
4847

test/hotspot/jtreg/gc/TestAllocateHeapAtError.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ public static void main(String args[]) throws Exception {
4545
f = new File(test_dir, UUID.randomUUID().toString());
4646
} while(f.exists());
4747

48-
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
48+
OutputAnalyzer output = ProcessTools.executeTestJava(
4949
"-XX:AllocateHeapAt=" + f.getName(),
5050
"-Xlog:gc+heap=info",
5151
"-Xmx32m",
5252
"-Xms32m",
5353
"-version");
54-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
5554

5655
System.out.println("Output:\n" + output.getOutput());
5756

test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ public static void main(String args[]) throws Exception {
6060
"-Xlog:gc+heap=info",
6161
"-version"});
6262

63-
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(flags);
64-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
63+
OutputAnalyzer output = ProcessTools.executeTestJava(flags);
6564

6665
System.out.println("Output:\n" + output.getOutput());
6766

test/hotspot/jtreg/gc/TestCardTablePageCommits.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ public static void main(String args[]) throws Exception {
4242
// because of 8kB pages, assume 4 KB pages for all other CPUs.
4343
String Xmx = "-Xmx4m";
4444

45-
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
45+
OutputAnalyzer output = ProcessTools.executeLimitedTestJava(
4646
Xmx,
4747
"-XX:NativeMemoryTracking=detail",
4848
"-XX:+UseParallelGC",
4949
"-version");
50-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
5150
output.shouldHaveExitValue(0);
5251
}
5352
}

test/hotspot/jtreg/gc/TestNumWorkerOutput.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static void checkPatternOnce(String pattern, String what) throws Exceptio
5858
}
5959

6060
public static void runTest(String gcArg) throws Exception {
61-
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
61+
OutputAnalyzer output = ProcessTools.executeLimitedTestJava(
6262
"-Xbootclasspath/a:.",
6363
"-XX:+UnlockExperimentalVMOptions",
6464
"-XX:+UnlockDiagnosticVMOptions",
@@ -67,7 +67,6 @@ public static void runTest(String gcArg) throws Exception {
6767
"-Xmx10M",
6868
"-XX:+PrintGCDetails",
6969
GCTest.class.getName());
70-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
7170

7271
output.shouldHaveExitValue(0);
7372

test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ private static void runTest(boolean shouldSucceed, String... extraArgs) throws E
4848
Collections.addAll(testArguments, extraArgs);
4949
testArguments.add("-version");
5050

51-
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(testArguments);
52-
53-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
51+
OutputAnalyzer output = ProcessTools.executeTestJava(testArguments);
5452

5553
System.out.println(output.getStderr());
5654

test/hotspot/jtreg/gc/TestSmallHeap.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,11 @@ public static void main(String[] args) throws Exception {
9696

9797
private static void verifySmallHeapSize(String gc, long expectedMaxHeap) throws Exception {
9898
long minMaxHeap = 4 * 1024 * 1024;
99-
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
99+
OutputAnalyzer analyzer = ProcessTools.executeLimitedTestJava(
100100
gc,
101101
"-Xmx" + minMaxHeap,
102102
"-XX:+PrintFlagsFinal",
103103
VerifyHeapSize.class.getName());
104-
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
105104
analyzer.shouldHaveExitValue(0);
106105

107106
expectedMaxHeap = Math.max(expectedMaxHeap, minMaxHeap);

test/hotspot/jtreg/gc/TestVerifyDuringStartup.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@
3737

3838
public class TestVerifyDuringStartup {
3939
public static void main(String args[]) throws Exception {
40-
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
40+
OutputAnalyzer output = ProcessTools.executeTestJava(
4141
"-XX:-UseTLAB",
4242
"-XX:+UnlockDiagnosticVMOptions",
4343
"-XX:+VerifyDuringStartup",
4444
"-Xlog:gc+verify=debug",
4545
"-version");
46-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
4746

4847
System.out.println("Output:\n" + output.getOutput());
4948

test/hotspot/jtreg/gc/TestVerifySilently.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ private static OutputAnalyzer runTest(boolean verifySilently) throws Exception {
5757
"-XX:+VerifyAfterGC",
5858
(verifySilently ? "-Xlog:gc":"-Xlog:gc+verify=debug"),
5959
TestVerifySilentlyRunSystemGC.class.getName()});
60-
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmOpts);
61-
OutputAnalyzer output = new OutputAnalyzer(pb.start());
60+
OutputAnalyzer output = ProcessTools.executeLimitedTestJava(vmOpts);
6261

6362
System.out.println("Output:\n" + output.getOutput());
6463
return output;

0 commit comments

Comments
 (0)