< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveRelocationTest.java

Print this page
@@ -28,13 +28,16 @@
   * @requires vm.cds
   * @summary Testing relocation of dynamic CDS archive (during both dump time and run time)
   * @comment JDK-8231610 Relocate the CDS archive if it cannot be mapped to the requested address
   * @bug 8231610
   * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes
-  * @build Hello
+  * @enablePreview
+  * @modules java.base/jdk.internal.value
+  *          java.base/jdk.internal.vm.annotation
+  * @compile ../test-classes/HelloInlineClassApp.java ../test-classes/HelloRelocation.java
   * @build jdk.test.whitebox.WhiteBox
-  * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar hello.jar Hello
+  * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar hello.jar HelloRelocation HelloInlineClassApp HelloInlineClassApp$Point HelloInlineClassApp$Rectangle  HelloInlineClassApp$ValueRecord
   * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
   * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. DynamicArchiveRelocationTest
   */
  
  import jdk.test.lib.process.OutputAnalyzer;

@@ -76,11 +79,11 @@
                             + ", top_reloc = " + dump_top_reloc
                             + ", run = " + run_reloc);
          System.out.println("============================================================");
  
          String appJar = ClassFileInstaller.getJarPath("hello.jar");
-         String mainClass = "Hello";
+         String mainClass = "HelloRelocation";
          String maybeRelocation = "-XX:ArchiveRelocationMode=0";
          String alwaysRelocation = "-XX:ArchiveRelocationMode=1";
          String dumpTopRelocArg  = dump_top_reloc  ? alwaysRelocation : maybeRelocation;
          String runRelocArg      = run_reloc       ? alwaysRelocation : maybeRelocation;
          String logArg = "-Xlog:cds=debug,cds+reloc=debug";

@@ -92,16 +95,17 @@
          String unlockArg = "-XX:+UnlockDiagnosticVMOptions";
          String relocationModeMsg = "ArchiveRelocationMode: 0";
  
          // (1) Dump base archive (static)
  
-         TestCommon.dumpBaseArchive(baseArchiveName, unlockArg, logArg)
+         TestCommon.dumpBaseArchive(baseArchiveName, "--enable-preview", unlockArg, logArg)
            .shouldContain("Relocating archive from");
  
          // (2) Dump top archive (dynamic)
  
          dump2(baseArchiveName, topArchiveName,
+               "--enable-preview",
                unlockArg,
                dumpTopRelocArg,
                logArg,
                "-cp", appJar, mainClass)
              .assertNormalExit(output -> {

@@ -111,10 +115,11 @@
                          output.shouldContain(relocationModeMsg);
                      }
                  });
  
          run2(baseArchiveName, topArchiveName,
+              "--enable-preview",
               unlockArg,
               runRelocArg,
               logArg,
              "-cp", appJar, mainClass)
              .assertNormalExit(output -> {
< prev index next >