33
34 // this file is auto-generated by $0. Do not edit manually.
35
36 /*
37 * @test
38 * @summary Run the $fname test in dynamic CDS archive mode.
39 * @requires vm.cds & vm.compMode != "Xcomp"
40 * @comment Some of the tests run excessively slowly with -Xcomp. The original
41 * tests aren't executed with -Xcomp in the CI pipeline, so let's exclude
42 * the generated tests from -Xcomp execution as well.
43 * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds
44 * /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive
45 * /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes
46 * @compile ../../../../../../../jdk/java/lang/invoke/MethodHandlesTest.java
47 * ../../../../../../../lib/jdk/test/lib/Utils.java
48 * ../../../../../../../jdk/java/lang/invoke/$fname
49 * ../../../../../../../jdk/java/lang/invoke/remote/RemoteExample.java
50 * ../../../../../../../jdk/java/lang/invoke/common/test/java/lang/invoke/lib/CodeCacheOverflowProcessor.java
51 * ../test-classes/TestMHApp.java
52 * @build sun.hotspot.WhiteBox
53 * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox\$WhiteBoxPermission
54 * @run junit/othervm/timeout=240 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. $i
55 */
56
57 import org.junit.Test;
58
59 import java.io.File;
60
61 import jtreg.SkippedException;
62
63 import sun.hotspot.gc.GC;
64
65 public class $i extends DynamicArchiveTestBase {
66 @Test
67 public void test() throws Exception {
68 runTest($i::testImpl);
69 }
70
71 private static final String classDir = System.getProperty("test.classes");
72 private static final String mainClass = "TestMHApp";
73 private static final String javaClassPath = System.getProperty("java.class.path");
74 private static final String ps = System.getProperty("path.separator");
75 private static final String testPackageName = "test.java.lang.invoke";
76 private static final String testClassName = "$i";
77 private static final String skippedException = "jtreg.SkippedException: Unable to map shared archive: test did not complete";
78
79 static void testImpl() throws Exception {
80 String topArchiveName = getNewArchiveName();
81 JarBuilder.build("MH", new File(classDir), null);
82 String appJar = classDir + File.separator + "MH.jar";
83
84 String[] classPaths = javaClassPath.split(File.pathSeparator);
85 String junitJar = null;
86 for (String path : classPaths) {
87 if (path.endsWith("junit.jar")) {
88 junitJar = path;
89 break;
90 }
91 }
92
93 dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
94 "-cp", appJar + ps + junitJar,
95 mainClass, testPackageName + "." + testClassName);
96 }
97 }
|
33
34 // this file is auto-generated by $0. Do not edit manually.
35
36 /*
37 * @test
38 * @summary Run the $fname test in dynamic CDS archive mode.
39 * @requires vm.cds & vm.compMode != "Xcomp"
40 * @comment Some of the tests run excessively slowly with -Xcomp. The original
41 * tests aren't executed with -Xcomp in the CI pipeline, so let's exclude
42 * the generated tests from -Xcomp execution as well.
43 * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds
44 * /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive
45 * /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes
46 * @compile ../../../../../../../jdk/java/lang/invoke/MethodHandlesTest.java
47 * ../../../../../../../lib/jdk/test/lib/Utils.java
48 * ../../../../../../../jdk/java/lang/invoke/$fname
49 * ../../../../../../../jdk/java/lang/invoke/remote/RemoteExample.java
50 * ../../../../../../../jdk/java/lang/invoke/common/test/java/lang/invoke/lib/CodeCacheOverflowProcessor.java
51 * ../test-classes/TestMHApp.java
52 * @build sun.hotspot.WhiteBox
53 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
54 * @run junit/othervm/timeout=240 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. $i
55 */
56
57 import org.junit.Test;
58
59 import java.io.File;
60
61 import sun.hotspot.gc.GC;
62
63 public class $i extends DynamicArchiveTestBase {
64 @Test
65 public void test() throws Exception {
66 runTest($i::testImpl);
67 }
68
69 private static final String classDir = System.getProperty("test.classes");
70 private static final String mainClass = "TestMHApp";
71 private static final String javaClassPath = System.getProperty("java.class.path");
72 private static final String ps = System.getProperty("path.separator");
73 private static final String testPackageName = "test.java.lang.invoke";
74 private static final String testClassName = "$i";
75
76 static void testImpl() throws Exception {
77 String topArchiveName = getNewArchiveName();
78 JarBuilder.build("MH", new File(classDir), null);
79 String appJar = classDir + File.separator + "MH.jar";
80
81 String[] classPaths = javaClassPath.split(File.pathSeparator);
82 String junitJar = null;
83 for (String path : classPaths) {
84 if (path.endsWith("junit.jar")) {
85 junitJar = path;
86 break;
87 }
88 }
89
90 dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
91 "-cp", appJar + ps + junitJar,
92 mainClass, testPackageName + "." + testClassName);
93 }
94 }
|