< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/MoveJDKTest.java

Print this page
rev 59103 : imported patch hotspot


  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /*
  26  * @test
  27  * @summary Test that CDS still works when the JDK is moved to a new directory
  28  * @requires vm.cds
  29  * @requires os.family == "linux"
  30  * @library /test/lib
  31  * @compile test-classes/Hello.java
  32  * @run driver MoveJDKTest
  33  */
  34 
  35 // This test works only on Linux because it depends on symlinks and the name of the hotspot DLL (libjvm.so).
  36 // It probably doesn't work on Windows.
  37 // TODO: change libjvm.so to libjvm.dylib on MacOS, before adding "@requires os.family == mac"
  38 // TODO: test on solaris, before adding "@requires os.family == solaris"
  39 
  40 import java.io.File;
  41 import java.nio.file.Files;
  42 import java.nio.file.Path;
  43 import java.nio.file.Paths;
  44 import java.nio.file.StandardCopyOption;
  45 import jdk.test.lib.process.OutputAnalyzer;
  46 
  47 public class MoveJDKTest {
  48     public static void main(String[] args) throws Exception {
  49         String java_home_src = System.getProperty("java.home");
  50         String java_home_dst = System.getProperty("user.dir") + File.separator + "moved_jdk";
  51 
  52         TestCommon.startNewArchiveName();
  53         String jsaFile = TestCommon.getCurrentArchiveName();
  54         String jsaOpt = "-XX:SharedArchiveFile=" + jsaFile;
  55         {
  56             ProcessBuilder pb = makeBuilder(java_home_src + "/bin/java", "-Xshare:dump", jsaOpt);
  57             TestCommon.executeAndLog(pb, "dump");
  58         }




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /*
  26  * @test
  27  * @summary Test that CDS still works when the JDK is moved to a new directory
  28  * @requires vm.cds
  29  * @requires os.family == "linux"
  30  * @library /test/lib
  31  * @compile test-classes/Hello.java
  32  * @run driver MoveJDKTest
  33  */
  34 
  35 // This test works only on Linux because it depends on symlinks and the name of the hotspot DLL (libjvm.so).
  36 // It probably doesn't work on Windows.
  37 // TODO: change libjvm.so to libjvm.dylib on MacOS, before adding "@requires os.family == mac"

  38 
  39 import java.io.File;
  40 import java.nio.file.Files;
  41 import java.nio.file.Path;
  42 import java.nio.file.Paths;
  43 import java.nio.file.StandardCopyOption;
  44 import jdk.test.lib.process.OutputAnalyzer;
  45 
  46 public class MoveJDKTest {
  47     public static void main(String[] args) throws Exception {
  48         String java_home_src = System.getProperty("java.home");
  49         String java_home_dst = System.getProperty("user.dir") + File.separator + "moved_jdk";
  50 
  51         TestCommon.startNewArchiveName();
  52         String jsaFile = TestCommon.getCurrentArchiveName();
  53         String jsaOpt = "-XX:SharedArchiveFile=" + jsaFile;
  54         {
  55             ProcessBuilder pb = makeBuilder(java_home_src + "/bin/java", "-Xshare:dump", jsaOpt);
  56             TestCommon.executeAndLog(pb, "dump");
  57         }


< prev index next >