< prev index next >

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

Print this page


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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  * @modules java.base/jdk.internal.misc
  32  *          java.management
  33  *          jdk.jartool/sun.tools.jar
  34  * @compile test-classes/Hello.java
  35  * @run main MoveJDKTest
  36  */
  37 
  38 // This test works only on Linux because it depends on symlinks and the name of the hotspot DLL (libjvm.so).
  39 // It probably doesn't work on Windows.
  40 // TODO: change libjvm.so to libjvm.dylib on MacOS, before adding "@requires os.family == mac"
  41 // TODO: test on solaris, before adding "@requires os.family == solaris"
  42 
  43 import java.io.File;
  44 import java.nio.file.Files;
  45 import java.nio.file.Path;
  46 import java.nio.file.Paths;
  47 import java.nio.file.StandardCopyOption;
  48 import jdk.test.lib.process.OutputAnalyzer;
  49 
  50 public class MoveJDKTest {
  51     public static void main(String[] args) throws Exception {
  52         String java_home_src = System.getProperty("java.home");
  53         String java_home_dst = System.getProperty("user.dir") + File.separator + "moved_jdk";
  54 
  55         TestCommon.startNewArchiveName();




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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  * @modules java.base/jdk.internal.misc
  32  *          java.management
  33  *          jdk.jartool/sun.tools.jar
  34  * @compile test-classes/Hello.java
  35  * @run driver MoveJDKTest
  36  */
  37 
  38 // This test works only on Linux because it depends on symlinks and the name of the hotspot DLL (libjvm.so).
  39 // It probably doesn't work on Windows.
  40 // TODO: change libjvm.so to libjvm.dylib on MacOS, before adding "@requires os.family == mac"
  41 // TODO: test on solaris, before adding "@requires os.family == solaris"
  42 
  43 import java.io.File;
  44 import java.nio.file.Files;
  45 import java.nio.file.Path;
  46 import java.nio.file.Paths;
  47 import java.nio.file.StandardCopyOption;
  48 import jdk.test.lib.process.OutputAnalyzer;
  49 
  50 public class MoveJDKTest {
  51     public static void main(String[] args) throws Exception {
  52         String java_home_src = System.getProperty("java.home");
  53         String java_home_dst = System.getProperty("user.dir") + File.separator + "moved_jdk";
  54 
  55         TestCommon.startNewArchiveName();


< prev index next >