23 */
24
25 /*
26 * @test
27 * @summary A few edge cases where there's no class to be included in the dynamic archive.
28 * @requires vm.cds & !vm.graal.enabled
29 * @comment The test assumes that when "java -version" is executed, only a very limited number
30 * of classes are loaded, and all of those are loaded from the default shared archive.
31 *
32 * However, when graal is used as the JIT, many extra classes are loaded during VM start-up.
33 * Some of those are loaded dynamically from jrt:/. Some classes are also defined by
34 * LambdaMetafactory. This causes complexity that cannot be easily handled by this test.
35 *
36 * The VM code covered by this test can be sufficiently tested with C1/C2. So there's no need
37 * to bend over backwards to run this test with graal.
38 *
39 * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes
40 * @build StrConcatApp
41 * @build sun.hotspot.WhiteBox
42 * @run driver ClassFileInstaller -jar strConcatApp.jar StrConcatApp
43 * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
44 * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. NoClassToArchive
45 */
46
47 import java.io.File;
48 import jdk.test.lib.process.OutputAnalyzer;
49 import jdk.test.lib.process.ProcessTools;
50
51 public class NoClassToArchive extends DynamicArchiveTestBase {
52 static final String warningMessage =
53 "There is no class to be included in the dynamic archive";
54 static final String classList = System.getProperty("test.classes") +
55 File.separator + "NoClassToArchive.list";
56 static final String appClass = "StrConcatApp";
57
58 public static void main(String[] args) throws Exception {
59 runTest(NoClassToArchive::testDefaultBase);
60 runTest(NoClassToArchive::testCustomBase);
61 }
62
63 // (1) Test with default base archive + top archive
|
23 */
24
25 /*
26 * @test
27 * @summary A few edge cases where there's no class to be included in the dynamic archive.
28 * @requires vm.cds & !vm.graal.enabled
29 * @comment The test assumes that when "java -version" is executed, only a very limited number
30 * of classes are loaded, and all of those are loaded from the default shared archive.
31 *
32 * However, when graal is used as the JIT, many extra classes are loaded during VM start-up.
33 * Some of those are loaded dynamically from jrt:/. Some classes are also defined by
34 * LambdaMetafactory. This causes complexity that cannot be easily handled by this test.
35 *
36 * The VM code covered by this test can be sufficiently tested with C1/C2. So there's no need
37 * to bend over backwards to run this test with graal.
38 *
39 * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes
40 * @build StrConcatApp
41 * @build sun.hotspot.WhiteBox
42 * @run driver ClassFileInstaller -jar strConcatApp.jar StrConcatApp
43 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
44 * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. NoClassToArchive
45 */
46
47 import java.io.File;
48 import jdk.test.lib.process.OutputAnalyzer;
49 import jdk.test.lib.process.ProcessTools;
50
51 public class NoClassToArchive extends DynamicArchiveTestBase {
52 static final String warningMessage =
53 "There is no class to be included in the dynamic archive";
54 static final String classList = System.getProperty("test.classes") +
55 File.separator + "NoClassToArchive.list";
56 static final String appClass = "StrConcatApp";
57
58 public static void main(String[] args) throws Exception {
59 runTest(NoClassToArchive::testDefaultBase);
60 runTest(NoClassToArchive::testCustomBase);
61 }
62
63 // (1) Test with default base archive + top archive
|