8202282: [TESTBUG] appcds TestCommon.makeCommandLineForAppCDS() can be removed

Removed the unnecessary makeCommandLineForAppCDS() method and its usage

Reviewed-by: iklam, jiangli
This commit is contained in:
Calvin Cheung 2018-09-26 18:21:26 -07:00
parent 6d6b22c277
commit 5108d2e1dd
4 changed files with 8 additions and 18 deletions

View File

@ -87,7 +87,6 @@ public class GraalWithLimitedMetaspace {
static void dumpLoadedClasses(String[] expectedClasses) throws Exception { static void dumpLoadedClasses(String[] expectedClasses) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
TestCommon.makeCommandLineForAppCDS(
"-XX:DumpLoadedClassList=" + CLASSLIST_FILE, "-XX:DumpLoadedClassList=" + CLASSLIST_FILE,
// trigger JVMCI runtime init so that JVMCI classes will be // trigger JVMCI runtime init so that JVMCI classes will be
// included in the classlist // included in the classlist
@ -95,7 +94,7 @@ public class GraalWithLimitedMetaspace {
"-cp", "-cp",
TESTJAR, TESTJAR,
TESTNAME, TESTNAME,
TEST_OUT)); TEST_OUT);
OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-loaded-classes") OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-loaded-classes")
.shouldHaveExitValue(0) .shouldHaveExitValue(0)
@ -113,7 +112,6 @@ public class GraalWithLimitedMetaspace {
static void dumpArchive() throws Exception { static void dumpArchive() throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
TestCommon.makeCommandLineForAppCDS(
"-cp", "-cp",
TESTJAR, TESTJAR,
"-XX:SharedClassListFile=" + CLASSLIST_FILE, "-XX:SharedClassListFile=" + CLASSLIST_FILE,
@ -121,7 +119,7 @@ public class GraalWithLimitedMetaspace {
"-Xlog:cds", "-Xlog:cds",
"-Xshare:dump", "-Xshare:dump",
"-XX:MetaspaceSize=12M", "-XX:MetaspaceSize=12M",
"-XX:MaxMetaspaceSize=12M")); "-XX:MaxMetaspaceSize=12M");
OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-archive"); OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-archive");
int exitValue = output.getExitValue(); int exitValue = output.getExitValue();

View File

@ -110,10 +110,6 @@ public class TestCommon extends CDSTestUtils {
return createArchive(opts); return createArchive(opts);
} }
public static String[] makeCommandLineForAppCDS(String... args) throws Exception {
return args;
}
// Create AppCDS archive using appcds options // Create AppCDS archive using appcds options
public static OutputAnalyzer createArchive(AppCDSOptions opts) public static OutputAnalyzer createArchive(AppCDSOptions opts)
throws Exception { throws Exception {
@ -143,7 +139,7 @@ public class TestCommon extends CDSTestUtils {
for (String s : opts.suffix) cmd.add(s); for (String s : opts.suffix) cmd.add(s);
String[] cmdLine = cmd.toArray(new String[cmd.size()]); String[] cmdLine = cmd.toArray(new String[cmd.size()]);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, makeCommandLineForAppCDS(cmdLine)); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, cmdLine);
return executeAndLog(pb, "dump"); return executeAndLog(pb, "dump");
} }
@ -169,7 +165,7 @@ public class TestCommon extends CDSTestUtils {
for (String s : opts.suffix) cmd.add(s); for (String s : opts.suffix) cmd.add(s);
String[] cmdLine = cmd.toArray(new String[cmd.size()]); String[] cmdLine = cmd.toArray(new String[cmd.size()]);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, makeCommandLineForAppCDS(cmdLine)); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, cmdLine);
return executeAndLog(pb, "exec"); return executeAndLog(pb, "exec");
} }

View File

@ -49,24 +49,22 @@ public class SharedStringsBasic {
TestCommon.getSourceFile("SharedStringsBasic.txt").toString(); TestCommon.getSourceFile("SharedStringsBasic.txt").toString();
ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true, ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true,
TestCommon.makeCommandLineForAppCDS(
"-cp", appJar, "-cp", appJar,
"-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile, "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile,
"-XX:SharedArchiveFile=./SharedStringsBasic.jsa", "-XX:SharedArchiveFile=./SharedStringsBasic.jsa",
"-Xshare:dump", "-Xshare:dump",
"-Xlog:cds,cds+hashtables")); "-Xlog:cds,cds+hashtables");
TestCommon.executeAndLog(dumpPb, "dump") TestCommon.executeAndLog(dumpPb, "dump")
.shouldContain("Shared string table stats") .shouldContain("Shared string table stats")
.shouldHaveExitValue(0); .shouldHaveExitValue(0);
ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true, ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true,
TestCommon.makeCommandLineForAppCDS(
"-cp", appJar, "-cp", appJar,
"-XX:SharedArchiveFile=./SharedStringsBasic.jsa", "-XX:SharedArchiveFile=./SharedStringsBasic.jsa",
"-Xshare:auto", "-Xshare:auto",
"-showversion", "-showversion",
"HelloString")); "HelloString");
TestCommon.executeAndLog(runPb, "run").shouldHaveExitValue(0); TestCommon.executeAndLog(runPb, "run").shouldHaveExitValue(0);
} }

View File

@ -44,21 +44,19 @@ public class SysDictCrash {
// SharedBaseAddress=0 puts the archive at a very high address on solaris, // SharedBaseAddress=0 puts the archive at a very high address on solaris,
// which provokes the crash. // which provokes the crash.
ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true, ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true,
TestCommon.makeCommandLineForAppCDS(
"-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5", "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5",
"-cp", ".", "-cp", ".",
"-XX:SharedBaseAddress=0", "-XX:SharedArchiveFile=./SysDictCrash.jsa", "-XX:SharedBaseAddress=0", "-XX:SharedArchiveFile=./SysDictCrash.jsa",
"-Xshare:dump", "-Xshare:dump",
"-showversion", "-Xlog:cds,cds+hashtables")); "-showversion", "-Xlog:cds,cds+hashtables");
TestCommon.checkDump(TestCommon.executeAndLog(dumpPb, "dump")); TestCommon.checkDump(TestCommon.executeAndLog(dumpPb, "dump"));
ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true, ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true,
TestCommon.makeCommandLineForAppCDS(
"-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5", "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5",
"-XX:SharedArchiveFile=./SysDictCrash.jsa", "-XX:SharedArchiveFile=./SysDictCrash.jsa",
"-Xshare:on", "-Xshare:on",
"-version")); "-version");
TestCommon.checkExec(TestCommon.executeAndLog(runPb, "exec")); TestCommon.checkExec(TestCommon.executeAndLog(runPb, "exec"));
} }