< prev index next >

test/tools/jimage/JImageToolTest.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -20,31 +20,31 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 /*
  * @test
- * @library /lib/testlibrary
+ * @library /test/lib
  * @build jdk.testlibrary.*
- * @summary Test to see if jimage tool extracts and recreates correctly.
+ * @summary Test to check if jimage tool exists and is working
  * @run main/timeout=360 JImageToolTest
  */
 
+import jdk.test.lib.process.ProcessTools;
+
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
 
-import jdk.testlibrary.ProcessTools;
-
 /**
  * Basic test for jimage tool.
  */
 public class JImageToolTest {
     private static void jimage(String... jimageArgs) throws Exception {
         ArrayList<String> args = new ArrayList<>();
-        args.add("-ms8m");
+        args.add("-ms64m");
         args.add("jdk.tools.jimage.Main");
         args.addAll(Arrays.asList(jimageArgs));
 
         ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(args.toArray(new String[args.size()]));
         int res = builder.inheritIO().start().waitFor();

@@ -59,15 +59,11 @@
         Path jimagePath = Paths.get(home, "bin", "jimage");
         Path modulesimagePath = Paths.get(home, "lib", "modules");
 
         if (Files.exists(jimagePath) && Files.exists(modulesimagePath)) {
             String jimage = jimagePath.toAbsolutePath().toString();
-            String bootimage = modulesimagePath.toAbsolutePath().toString();
-            String extractDir = Paths.get(".", "extract").toAbsolutePath().toString();
-            jimage("list", bootimage);
-            jimage("verify", bootimage);
-            jimage("extract", "--dir", extractDir, bootimage);
+            jimage("--version");
             System.out.println("Test successful");
          } else {
             System.out.println("Test skipped, not an images build");
          }
     }
< prev index next >