8234304: runtime/cds/appcds/javaldr tests should use driver mode

Reviewed-by: iklam, mseledtsov
This commit is contained in:
Igor Ignatyev 2019-11-18 14:13:11 -08:00
parent b3860fd4da
commit d27bcbec06
5 changed files with 25 additions and 30 deletions

View File

@ -32,16 +32,15 @@
* @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes
* @requires vm.cds
* @requires vm.flavor != "minimal"
* @build AnonVmClassesDuringDumpTransformer Hello
* @run main/othervm AnonVmClassesDuringDump
* @run driver AnonVmClassesDuringDump
*/
public class AnonVmClassesDuringDump {
public static String appClasses[] = {
"Hello",
Hello.class.getName(),
};
public static String agentClasses[] = {
"AnonVmClassesDuringDumpTransformer",
AnonVmClassesDuringDumpTransformer.class.getName(),
};
public static String cdsDiagnosticOption = "-XX:+AllowArchivingWithJavaAgent";
@ -55,7 +54,7 @@ public class AnonVmClassesDuringDump {
String appJar =
ClassFileInstaller.writeJar("AnonVmClassesDuringDumpApp.jar", appClasses);
TestCommon.testDump(appJar, TestCommon.list("Hello"),
TestCommon.testDump(appJar, TestCommon.list(Hello.class.getName()),
"-javaagent:" + agentJar,
"-XX:+UnlockDiagnosticVMOptions", cdsDiagnosticOption,
// Set the following property to see logs for dynamically generated classes
@ -71,13 +70,13 @@ public class AnonVmClassesDuringDump {
String pattern = prefix + class_pattern + suffix;
// during run time, anonymous classes shouldn't be loaded from the archive
TestCommon.run("-cp", appJar,
"-XX:+UnlockDiagnosticVMOptions", cdsDiagnosticOption, "Hello")
"-XX:+UnlockDiagnosticVMOptions", cdsDiagnosticOption, Hello.class.getName())
.assertNormalExit(output -> output.shouldNotMatch(pattern));
// inspect the archive and make sure no anonymous class is in there
TestCommon.run("-cp", appJar,
"-XX:+UnlockDiagnosticVMOptions", cdsDiagnosticOption,
"-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary", "Hello")
"-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary", Hello.class.getName())
.assertNormalExit(output -> output.shouldNotMatch(class_pattern));
}
}

View File

@ -28,7 +28,6 @@
* @requires vm.cds
* @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds
* @modules jdk.jartool/sun.tools.jar
* @compile ArrayTestHelper.java
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* @run driver ArrayTest
@ -41,7 +40,7 @@ import jdk.test.lib.process.OutputAnalyzer;
public class ArrayTest {
static String arrayClasses[] = {
"ArrayTestHelper",
ArrayTestHelper.class.getName(),
"[Ljava/lang/Comparable;",
"[I",
"[[[Ljava/lang/Object;",
@ -70,7 +69,7 @@ public class ArrayTest {
argsList.add("-cp");
argsList.add(appJar);
argsList.add(bootClassPath);
argsList.add("ArrayTestHelper");
argsList.add(ArrayTestHelper.class.getName());
// the following are input args to the ArrayTestHelper.
// skip checking array classes during run time
for (int i = 0; i < 1; i++) {

View File

@ -28,8 +28,7 @@
* @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes
* @requires vm.cds
* @requires vm.flavor != "minimal"
* @build GCDuringDumpTransformer Hello
* @run main/othervm GCDuringDump
* @run driver GCDuringDump
*/
import jdk.test.lib.cds.CDSOptions;
@ -38,10 +37,10 @@ import jdk.test.lib.process.ProcessTools;
public class GCDuringDump {
public static String appClasses[] = {
"Hello",
Hello.class.getName(),
};
public static String agentClasses[] = {
"GCDuringDumpTransformer",
GCDuringDumpTransformer.class.getName(),
};
public static void main(String[] args) throws Throwable {
@ -63,7 +62,7 @@ public class GCDuringDump {
String extraArg = (i == 0) ? "-showversion" : "-javaagent:" + agentJar;
String extraOption = (i == 0) ? "-showversion" : "-XX:+AllowArchivingWithJavaAgent";
TestCommon.testDump(appJar, TestCommon.list("Hello"),
TestCommon.testDump(appJar, TestCommon.list(Hello.class.getName()),
"-XX:+UnlockDiagnosticVMOptions", extraOption,
extraArg, "-Xmx32m", gcLog);
@ -73,7 +72,7 @@ public class GCDuringDump {
"-XX:+PrintSharedSpaces",
"-XX:+UnlockDiagnosticVMOptions", extraOption,
gcLog,
"Hello")
Hello.class.getName())
.assertNormalExit();
}
}

View File

@ -29,9 +29,9 @@
* @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes
* @requires vm.cds.archived.java.heap
* @modules jdk.jartool/sun.tools.jar
* @build sun.hotspot.WhiteBox GCDuringDumpTransformer GCSharedStringsDuringDumpWb
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm/timeout=480 GCSharedStringsDuringDump
* @run driver/timeout=480 GCSharedStringsDuringDump
*/
import java.io.File;
@ -41,14 +41,13 @@ import java.io.PrintWriter;
import jdk.test.lib.cds.CDSOptions;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import sun.hotspot.WhiteBox;
public class GCSharedStringsDuringDump {
public static String appClasses[] = {
"GCSharedStringsDuringDumpWb",
GCSharedStringsDuringDumpWb.class.getName(),
};
public static String agentClasses[] = {
"GCDuringDumpTransformer",
GCDuringDumpTransformer.class.getName(),
};
public static void main(String[] args) throws Throwable {
@ -88,7 +87,7 @@ public class GCSharedStringsDuringDump {
String extraArg = (i == 0) ? "-showversion" : "-javaagent:" + agentJar;
String extraOption = (i == 0) ? "-showversion" : "-XX:+AllowArchivingWithJavaAgent";
OutputAnalyzer output = TestCommon.dump(
appJar, TestCommon.list("GCSharedStringsDuringDumpWb"),
appJar, TestCommon.list(GCSharedStringsDuringDumpWb.class.getName()),
bootClassPath, extraArg, "-Xmx32m", gcLog,
"-XX:SharedArchiveConfigFile=" + sharedArchiveCfgFile,
"-XX:+UnlockDiagnosticVMOptions", extraOption);
@ -101,7 +100,7 @@ public class GCSharedStringsDuringDump {
// Try again with larger heap and NewSize, this should increase the
// G1 heap region size to 2M
TestCommon.testDump(
appJar, TestCommon.list("GCSharedStringsDuringDumpWb"),
appJar, TestCommon.list(GCSharedStringsDuringDumpWb.class.getName()),
bootClassPath, extraArg, "-Xmx8g", "-XX:NewSize=8m", gcLog,
"-XX:SharedArchiveConfigFile=" + sharedArchiveCfgFile,
"-XX:+UnlockDiagnosticVMOptions", extraOption);
@ -119,7 +118,7 @@ public class GCSharedStringsDuringDump {
"-XX:+WhiteBoxAPI",
"-XX:SharedReadOnlySize=30m",
gcLog,
"GCSharedStringsDuringDumpWb")
GCSharedStringsDuringDumpWb.class.getName())
.assertNormalExit();
}
}

View File

@ -28,8 +28,7 @@
* @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes
* @requires vm.cds.archived.java.heap
* @requires vm.flavor != "minimal"
* @build HumongousDuringDumpTransformer Hello
* @run main/othervm/timeout=240 HumongousDuringDump
* @run driver/timeout=240 HumongousDuringDump
*/
import jdk.test.lib.cds.CDSOptions;
@ -38,10 +37,10 @@ import jdk.test.lib.process.ProcessTools;
public class HumongousDuringDump {
public static String appClasses[] = {
"Hello",
Hello.class.getName(),
};
public static String agentClasses[] = {
"HumongousDuringDumpTransformer",
HumongousDuringDumpTransformer.class.getName(),
};
public static void main(String[] args) throws Throwable {
@ -60,7 +59,7 @@ public class HumongousDuringDump {
String extraOption = "-XX:+AllowArchivingWithJavaAgent";
OutputAnalyzer out =
TestCommon.testDump(appJar, TestCommon.list("Hello"),
TestCommon.testDump(appJar, TestCommon.list(Hello.class.getName()),
"-XX:+UnlockDiagnosticVMOptions", extraOption,
"-Xlog:gc+region+cds",
"-Xlog:gc+region=trace",
@ -79,7 +78,7 @@ public class HumongousDuringDump {
"-XX:+PrintSharedSpaces",
"-XX:+UnlockDiagnosticVMOptions", extraOption,
gcLog,
"Hello")
Hello.class.getName())
.assertNormalExit();
}
}