< prev index next > test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java
Print this page
System.out.println("0. Dump with ZGC");
OutputAnalyzer out = TestCommon
.dump(helloJar,
new String[] {"Hello"},
"-XX:+UseZGC",
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds");
out.shouldContain("Dumping shared data to file:");
out.shouldHaveExitValue(0);
System.out.println("1. Run with same args of dump");
out = TestCommon
.exec(helloJar,
"-XX:+UseZGC",
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds",
"Hello");
out.shouldContain(HELLO);
out.shouldHaveExitValue(0);
out = TestCommon
.exec(helloJar,
"-XX:-UseZGC",
"-XX:+UseCompressedOops", // in case turned off by vmoptions
"-XX:+UseCompressedClassPointers", // by jtreg
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds",
"Hello");
out.shouldContain(UNABLE_TO_USE_ARCHIVE);
out.shouldContain(ERR_MSG);
out.shouldHaveExitValue(1);
out = TestCommon
.exec(helloJar,
"-XX:+UseSerialGC",
"-XX:-UseCompressedOops",
"-XX:-UseCompressedClassPointers",
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds",
"Hello");
out.shouldContain(UNABLE_TO_USE_ARCHIVE);
out.shouldContain(ERR_MSG);
out.shouldHaveExitValue(1);
out = TestCommon
.exec(helloJar,
"-XX:+UseSerialGC",
"-XX:-UseCompressedOops",
"-XX:+UseCompressedClassPointers",
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds",
"Hello");
out.shouldContain(HELLO);
out.shouldHaveExitValue(0);
out = TestCommon
.exec(helloJar,
"-XX:+UseSerialGC",
"-XX:+UseCompressedOops",
"-XX:-UseCompressedClassPointers",
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds",
"Hello");
out.shouldContain(UNABLE_TO_USE_ARCHIVE);
out.shouldContain(ERR_MSG);
out.shouldHaveExitValue(1);
out = TestCommon
.exec(helloJar,
"-XX:+UseSerialGC",
"-XX:+UseCompressedOops",
"-XX:+UseCompressedClassPointers",
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds",
"Hello");
out.shouldContain(UNABLE_TO_USE_ARCHIVE);
out.shouldContain(ERR_MSG);
out.shouldHaveExitValue(1);
.dump(helloJar,
new String[] {"Hello"},
"-XX:+UseSerialGC",
"-XX:-UseCompressedOops",
"-XX:+UseCompressedClassPointers",
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds");
out.shouldContain("Dumping shared data to file:");
out.shouldHaveExitValue(0);
System.out.println("8. Run with ZGC");
out = TestCommon
.exec(helloJar,
"-XX:+UseZGC",
+ "-XX:+UnlockExperimentalVMOptions",
+ "-XX:-UseCompactObjectHeaders",
"-Xlog:cds",
"Hello");
out.shouldContain(HELLO);
out.shouldHaveExitValue(0);
}
< prev index next >