changeset 8943:f35456fc82ae

8133180: [TESTBUG] runtime/SharedArchiveFile/SharedStrings.java failed with WhiteBox.class : no such file or directory Summary: Removed ambiguity on where JarBuilder looks for classes Reviewed-by: jiangli, ctornqvi, gtriantafill
author mseledtsov
date Thu, 03 Sep 2015 08:57:16 -0700
parents f44314157fcb
children 1fb9e9f01532
files test/runtime/SharedArchiveFile/BasicJarBuilder.java test/runtime/SharedArchiveFile/SharedStrings.java test/runtime/SharedArchiveFile/SharedStringsWb.java
diffstat 3 files changed, 9 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/test/runtime/SharedArchiveFile/BasicJarBuilder.java	Thu Sep 03 10:22:39 2015 -0700
+++ b/test/runtime/SharedArchiveFile/BasicJarBuilder.java	Thu Sep 03 08:57:16 2015 -0700
@@ -35,14 +35,14 @@
 import java.util.ArrayList;
 import sun.tools.jar.Main;
 
+// Using JarBuilder requires that all to-be-jarred classes should be placed
+// in the current working directory, aka "."
 public class BasicJarBuilder {
     private static final String classDir = System.getProperty("test.classes");
 
-    public static void build(String jarName, String ...classNames)
-        throws Exception {
-
-        createSimpleJar(classDir, classDir + File.separator + jarName +
-            ".jar", classNames);
+    public static void build(String jarName, String ...classNames) throws Exception {
+        createSimpleJar(".", classDir + File.separator + jarName + ".jar",
+            classNames);
     }
 
     private static void createSimpleJar(String jarclassDir, String jarName,
@@ -71,7 +71,7 @@
         }
     }
 
-    // helpers
+    // Get full path to the test jar
     public static String getTestJar(String jar) {
         File dir = new File(System.getProperty("test.classes", "."));
         File jarFile = new File(dir, jar);
--- a/test/runtime/SharedArchiveFile/SharedStrings.java	Thu Sep 03 10:22:39 2015 -0700
+++ b/test/runtime/SharedArchiveFile/SharedStrings.java	Thu Sep 03 08:57:16 2015 -0700
@@ -32,12 +32,10 @@
  * @library /testlibrary /../../test/lib
  * @modules java.base/sun.misc
  *          java.management
- * @ignore - 8133180
- * @build SharedStringsWb SharedStrings BasicJarBuilder
+ * @build SharedStringsWb SharedStrings BasicJarBuilder sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main SharedStrings
  */
-
 import jdk.test.lib.*;
 
 public class SharedStrings {
--- a/test/runtime/SharedArchiveFile/SharedStringsWb.java	Thu Sep 03 10:22:39 2015 -0700
+++ b/test/runtime/SharedArchiveFile/SharedStringsWb.java	Thu Sep 03 08:57:16 2015 -0700
@@ -34,8 +34,8 @@
             return;
         }
 
-        // The string "java" is known to be interened and added to CDS archive
-        String s = "java";
+        // The string below is known to be added to CDS archive
+        String s = "<init>";
         String internedS = s.intern();
 
         if (wb.isShared(internedS)) {