Skip to content

Commit

Permalink
8202282: [TESTBUG] appcds TestCommon.makeCommandLineForAppCDS() can b…
Browse files Browse the repository at this point in the history
…e removed

Removed the unnecessary makeCommandLineForAppCDS() method and its usage

Reviewed-by: rrich
Backport-of: 5108d2e
  • Loading branch information
Amos Shi authored and reinrich committed Dec 13, 2023
1 parent 7833ea8 commit 7d85ecf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
Expand Up @@ -87,7 +87,6 @@ public static List<String> toClassNames(String filename) throws IOException {

static void dumpLoadedClasses(String[] expectedClasses) throws Exception {
ProcessBuilder pb = ProcessTools.createTestJvm(
TestCommon.makeCommandLineForAppCDS(
"-XX:DumpLoadedClassList=" + CLASSLIST_FILE,
// trigger JVMCI runtime init so that JVMCI classes will be
// included in the classlist
Expand All @@ -97,7 +96,7 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception {
"-cp",
TESTJAR,
TESTNAME,
TEST_OUT));
TEST_OUT);

OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-loaded-classes")
.shouldHaveExitValue(0)
Expand All @@ -115,15 +114,14 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception {

static void dumpArchive() throws Exception {
ProcessBuilder pb = ProcessTools.createTestJvm(
TestCommon.makeCommandLineForAppCDS(
"-cp",
TESTJAR,
"-XX:SharedClassListFile=" + CLASSLIST_FILE,
"-XX:SharedArchiveFile=" + ARCHIVE_FILE,
"-Xlog:cds",
"-Xshare:dump",
"-XX:MetaspaceSize=12M",
"-XX:MaxMetaspaceSize=12M"));
"-XX:MaxMetaspaceSize=12M");

OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-archive");
int exitValue = output.getExitValue();
Expand Down
4 changes: 0 additions & 4 deletions test/hotspot/jtreg/runtime/appcds/TestCommon.java
Expand Up @@ -114,10 +114,6 @@ public static OutputAnalyzer createArchive(String appJar, String appClasses[],
return createArchive(opts);
}

public static String[] makeCommandLineForAppCDS(String... args) throws Exception {
return args;
}

// Create AppCDS archive using appcds options
public static OutputAnalyzer createArchive(AppCDSOptions opts)
throws Exception {
Expand Down
Expand Up @@ -49,24 +49,22 @@ public static void main(String[] args) throws Exception {
TestCommon.getSourceFile("SharedStringsBasic.txt").toString();

ProcessBuilder dumpPb = ProcessTools.createTestJvm(
TestCommon.makeCommandLineForAppCDS(
"-cp", appJar,
"-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile,
"-XX:SharedArchiveFile=./SharedStringsBasic.jsa",
"-Xshare:dump",
"-Xlog:cds,cds+hashtables"));
"-Xlog:cds,cds+hashtables");

TestCommon.executeAndLog(dumpPb, "dump")
.shouldContain("Shared string table stats")
.shouldHaveExitValue(0);

ProcessBuilder runPb = ProcessTools.createTestJvm(
TestCommon.makeCommandLineForAppCDS(
"-cp", appJar,
"-XX:SharedArchiveFile=./SharedStringsBasic.jsa",
"-Xshare:auto",
"-showversion",
"HelloString"));
"HelloString");

TestCommon.executeAndLog(runPb, "run").shouldHaveExitValue(0);
}
Expand Down
Expand Up @@ -44,21 +44,19 @@ public static void main(String[] args) throws Exception {
// SharedBaseAddress=0 puts the archive at a very high address on solaris,
// which provokes the crash.
ProcessBuilder dumpPb = ProcessTools.createTestJvm(
TestCommon.makeCommandLineForAppCDS(
"-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5",
"-cp", ".",
"-XX:SharedBaseAddress=0", "-XX:SharedArchiveFile=./SysDictCrash.jsa",
"-Xshare:dump",
"-showversion", "-Xlog:cds,cds+hashtables"));
"-showversion", "-Xlog:cds,cds+hashtables");

TestCommon.checkDump(TestCommon.executeAndLog(dumpPb, "dump"));

ProcessBuilder runPb = ProcessTools.createTestJvm(
TestCommon.makeCommandLineForAppCDS(
"-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5",
"-XX:SharedArchiveFile=./SysDictCrash.jsa",
"-Xshare:on",
"-version"));
"-version");

TestCommon.checkExec(TestCommon.executeAndLog(runPb, "exec"));
}
Expand Down

1 comment on commit 7d85ecf

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.