changeset 7751:5c450268abbd

Added AddModuleExports to resolve test issues
author ctornqvi
date Wed, 28 Jan 2015 05:49:24 -0800
parents 401fcded71c4
children 52aa2e30e139
files test/runtime/8003720/Test8003720.java test/runtime/8026365/InvokeSpecialAnonTest.java test/runtime/ClassFile/UnsupportedClassFileVersion.java test/runtime/InternalApi/ThreadCpuTimesDeadlock.java test/runtime/NMT/BaselineWithParameter.java test/runtime/NMT/JcmdBaselineDetail.java test/runtime/NMT/JcmdScale.java test/runtime/NMT/JcmdScaleDetail.java test/runtime/NMT/JcmdSummaryDiff.java test/runtime/NMT/JcmdWithNMTDisabled.java test/runtime/NMT/MallocRoundingReportTest.java test/runtime/NMT/MallocTestType.java test/runtime/NMT/MallocTrackingVerify.java test/runtime/NMT/ReleaseNoCommit.java test/runtime/NMT/ShutdownTwice.java test/runtime/NMT/SummaryAfterShutdown.java test/runtime/NMT/SummarySanityCheck.java test/runtime/NMT/ThreadedMallocTestType.java test/runtime/NMT/ThreadedVirtualAllocTestType.java test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java test/runtime/NMT/VirtualAllocTestType.java test/runtime/RedefineTests/RedefineAnnotations.java test/runtime/RedefineTests/RedefineFinalizer.java test/runtime/RedefineTests/RedefineRunningMethods.java test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java test/runtime/Unsafe/RangeCheck.java test/runtime/contended/Basic.java test/runtime/contended/DefaultValue.java test/runtime/contended/Inheritance1.java test/runtime/finalStatic/FinalStatic.java test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java test/runtime/verifier/OverriderMsg.java test/runtime/verifier/TestANewArray.java test/runtime/verifier/TestMultiANewArray.java
diffstat 34 files changed, 43 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/test/runtime/8003720/Test8003720.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/8003720/Test8003720.java	Wed Jan 28 05:49:24 2015 -0800
@@ -27,7 +27,7 @@
  * @bug 8003720
  * @summary Method in interpreter stack frame can be deallocated
  * @compile -XDignore.symbol.file Victim.java
- * @run main/othervm -Xverify:all -Xint Test8003720
+ * @run main/othervm -Xverify:all -Xint -XX:AddModuleExports=java.base/sun.misc,java.base/jdk.internal.org.objectweb.asm Test8003720
  */
 
 // Attempts to make the JVM unload a class while still executing one of its methods.
--- a/test/runtime/8026365/InvokeSpecialAnonTest.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/8026365/InvokeSpecialAnonTest.java	Wed Jan 28 05:49:24 2015 -0800
@@ -29,7 +29,7 @@
  * @library /testlibrary
  * @compile -XDignore.symbol.file InvokeSpecialAnonTest.java
  * @run main ClassFileInstaller InvokeSpecialAnonTest AnonTester
- * @run main/othervm -Xbootclasspath/a:. -Xverify:all InvokeSpecialAnonTest
+ * @run main/othervm -Xbootclasspath/a:. -Xverify:all -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm,java.base/sun.misc InvokeSpecialAnonTest
  */
 import jdk.internal.org.objectweb.asm.*;
 import java.lang.reflect.Constructor;
--- a/test/runtime/ClassFile/UnsupportedClassFileVersion.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/ClassFile/UnsupportedClassFileVersion.java	Wed Jan 28 05:49:24 2015 -0800
@@ -25,7 +25,7 @@
  * @test
  * @library /testlibrary
  * @compile -XDignore.symbol.file UnsupportedClassFileVersion.java
- * @run main UnsupportedClassFileVersion
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm UnsupportedClassFileVersion
  */
 
 import java.io.File;
@@ -38,7 +38,7 @@
 public class UnsupportedClassFileVersion implements Opcodes {
     public static void main(String... args) throws Exception {
         writeClassFile();
-        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".",  "ClassFile");
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".", "ClassFile");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         output.shouldContain("ClassFile has been compiled by a more recent version of the " +
                             "Java Runtime (class file version 99.0), this version of " +
--- a/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java	Wed Jan 28 05:49:24 2015 -0800
@@ -27,7 +27,7 @@
  * @bug 7196045
  * @bug 8014294
  * @summary Possible JVM deadlock in ThreadTimesClosure when using HotspotInternal non-public API.
- * @run main/othervm -XX:+UsePerfData -Xmx32m ThreadCpuTimesDeadlock
+ * @run main/othervm -XX:+UsePerfData -Xmx32m -XX:AddModuleExports=java.management/sun.management ThreadCpuTimesDeadlock
  */
 
 import java.lang.management.ManagementFactory;
--- a/test/runtime/NMT/BaselineWithParameter.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/BaselineWithParameter.java	Wed Jan 28 05:49:24 2015 -0800
@@ -27,7 +27,7 @@
  * @key nmt jcmd regression
  * @summary Regression test for invoking a jcmd with baseline=false, result was that the target VM crashed
  * @library /testlibrary
- * @run main/othervm -XX:NativeMemoryTracking=detail BaselineWithParameter
+ * @run main/othervm -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management BaselineWithParameter
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/JcmdBaselineDetail.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/JcmdBaselineDetail.java	Wed Jan 28 05:49:24 2015 -0800
@@ -26,7 +26,7 @@
  * @key nmt jcmd
  * @summary Verify that jcmd correctly reports that baseline succeeds with NMT enabled with detailed tracking.
  * @library /testlibrary
- * @run main/othervm -XX:NativeMemoryTracking=detail JcmdBaselineDetail
+ * @run main/othervm -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management JcmdBaselineDetail
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/JcmdScale.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/JcmdScale.java	Wed Jan 28 05:49:24 2015 -0800
@@ -26,7 +26,7 @@
  * @key nmt jcmd
  * @summary Test the NMT scale parameter
  * @library /testlibrary
- * @run main/othervm -XX:NativeMemoryTracking=summary JcmdScale
+ * @run main/othervm -XX:NativeMemoryTracking=summary -XX:AddModuleExports=java.management/sun.management JcmdScale
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/JcmdScaleDetail.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/JcmdScaleDetail.java	Wed Jan 28 05:49:24 2015 -0800
@@ -26,7 +26,7 @@
  * @key nmt jcmd
  * @summary Test the NMT scale parameter with detail tracking level
  * @library /testlibrary
- * @run main/othervm -XX:NativeMemoryTracking=detail JcmdScaleDetail
+ * @run main/othervm -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management JcmdScaleDetail
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/JcmdSummaryDiff.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/JcmdSummaryDiff.java	Wed Jan 28 05:49:24 2015 -0800
@@ -28,7 +28,7 @@
  * @library /testlibrary /../../test/lib
  * @build JcmdSummaryDiff
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary JcmdSummaryDiff
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary -XX:AddModuleExports=java.management/sun.management JcmdSummaryDiff
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/JcmdWithNMTDisabled.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/JcmdWithNMTDisabled.java	Wed Jan 28 05:49:24 2015 -0800
@@ -45,12 +45,12 @@
       String testjdkPath = System.getProperty("test.jdk");
 
       // First run without enabling NMT
-      pb = ProcessTools.createJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "JcmdWithNMTDisabled");
+      pb = ProcessTools.createJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "-XX:AddModuleExports=java.management/sun.management", "JcmdWithNMTDisabled");
       output = new OutputAnalyzer(pb.start());
       output.shouldHaveExitValue(0);
 
       // Then run with explicitly disabling NMT, should not be any difference
-      pb = ProcessTools.createJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "-XX:NativeMemoryTracking=off", "JcmdWithNMTDisabled");
+      pb = ProcessTools.createJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "-XX:NativeMemoryTracking=off", "-XX:AddModuleExports=java.management/sun.management", "JcmdWithNMTDisabled");
       output = new OutputAnalyzer(pb.start());
       output.shouldHaveExitValue(0);
 
--- a/test/runtime/NMT/MallocRoundingReportTest.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/MallocRoundingReportTest.java	Wed Jan 28 05:49:24 2015 -0800
@@ -28,7 +28,7 @@
  * @library /testlibrary /../../test/lib
  * @build MallocRoundingReportTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocRoundingReportTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management MallocRoundingReportTest
  *
  */
 
--- a/test/runtime/NMT/MallocTestType.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/MallocTestType.java	Wed Jan 28 05:49:24 2015 -0800
@@ -29,7 +29,7 @@
  * @build MallocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTestType
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management MallocTestType
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/MallocTrackingVerify.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/MallocTrackingVerify.java	Wed Jan 28 05:49:24 2015 -0800
@@ -29,7 +29,7 @@
  * @library /testlibrary /../../test/lib
  * @build MallocTrackingVerify
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTrackingVerify
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management MallocTrackingVerify
  *
  */
 
--- a/test/runtime/NMT/ReleaseNoCommit.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/ReleaseNoCommit.java	Wed Jan 28 05:49:24 2015 -0800
@@ -28,7 +28,7 @@
  * @library /testlibrary /../../test/lib
  * @build ReleaseNoCommit
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary ReleaseNoCommit
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary -XX:AddModuleExports=java.management/sun.management ReleaseNoCommit
  */
 
 import com.oracle.java.testlibrary.JDKToolFinder;
--- a/test/runtime/NMT/ShutdownTwice.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/ShutdownTwice.java	Wed Jan 28 05:49:24 2015 -0800
@@ -26,7 +26,7 @@
  * @key nmt jcmd
  * @summary Run shutdown twice
  * @library /testlibrary
- * @run main/othervm -XX:NativeMemoryTracking=detail ShutdownTwice
+ * @run main/othervm -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management ShutdownTwice
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/SummaryAfterShutdown.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/SummaryAfterShutdown.java	Wed Jan 28 05:49:24 2015 -0800
@@ -26,7 +26,7 @@
  * @key nmt jcmd
  * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown
  * @library /testlibrary
- * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown
+ * @run main/othervm -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management SummaryAfterShutdown
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/SummarySanityCheck.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/SummarySanityCheck.java	Wed Jan 28 05:49:24 2015 -0800
@@ -29,7 +29,7 @@
  * @build SummarySanityCheck
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI -XX:AddModuleExports=java.management/sun.management SummarySanityCheck
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/ThreadedMallocTestType.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/ThreadedMallocTestType.java	Wed Jan 28 05:49:24 2015 -0800
@@ -28,7 +28,7 @@
  * @build ThreadedMallocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management ThreadedMallocTestType
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Wed Jan 28 05:49:24 2015 -0800
@@ -28,7 +28,7 @@
  * @build ThreadedVirtualAllocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedVirtualAllocTestType
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management ThreadedVirtualAllocTestType
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java	Wed Jan 28 05:49:24 2015 -0800
@@ -28,7 +28,7 @@
  * @library /testlibrary /../../test/lib
  * @build VirtualAllocCommitUncommitRecommit
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocCommitUncommitRecommit
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management VirtualAllocCommitUncommitRecommit
  *
  */
 
--- a/test/runtime/NMT/VirtualAllocTestType.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/NMT/VirtualAllocTestType.java	Wed Jan 28 05:49:24 2015 -0800
@@ -29,7 +29,7 @@
  * @build VirtualAllocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocTestType
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail -XX:AddModuleExports=java.management/sun.management VirtualAllocTestType
  */
 
 import com.oracle.java.testlibrary.*;
--- a/test/runtime/RedefineTests/RedefineAnnotations.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/RedefineTests/RedefineAnnotations.java	Wed Jan 28 05:49:24 2015 -0800
@@ -25,8 +25,8 @@
  * @test
  * @library /testlibrary
  * @summary Test that type annotations are retained after a retransform
- * @run main RedefineAnnotations buildagent
- * @run main/othervm -javaagent:redefineagent.jar RedefineAnnotations
+ * @run main/othervm -XX:AddModuleExports=jdk.dev/sun.tools.jar RedefineAnnotations buildagent
+ * @run main/othervm -javaagent:redefineagent.jar -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm RedefineAnnotations
  */
 
 import static com.oracle.java.testlibrary.Asserts.assertTrue;
--- a/test/runtime/RedefineTests/RedefineFinalizer.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/RedefineTests/RedefineFinalizer.java	Wed Jan 28 05:49:24 2015 -0800
@@ -27,7 +27,7 @@
  * @summary Don't assert if we redefine finalize method
  * @library /testlibrary
  * @build RedefineClassHelper
- * @run main RedefineClassHelper
+ * @run main/othervm -XX:AddModuleExports=jdk.dev/sun.tools.jar RedefineClassHelper
  * @run main/othervm -javaagent:redefineagent.jar RedefineFinalizer
  */
 
--- a/test/runtime/RedefineTests/RedefineRunningMethods.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/RedefineTests/RedefineRunningMethods.java	Wed Jan 28 05:49:24 2015 -0800
@@ -27,7 +27,7 @@
  * @summary Redefine EMCP and non-EMCP methods that are running in an infinite loop
  * @library /testlibrary
  * @build RedefineClassHelper
- * @run main RedefineClassHelper
+ * @run main/othervm -XX:AddModuleExports=jdk.dev/sun.tools.jar RedefineClassHelper
  * @run main/othervm -javaagent:redefineagent.jar -XX:TraceRedefineClasses=0x600 RedefineRunningMethods
  */
 public class RedefineRunningMethods {
--- a/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java	Wed Jan 28 05:49:24 2015 -0800
@@ -56,24 +56,6 @@
       output.shouldNotContain("Usage:");           // Should not print JVM help message
       output.shouldHaveExitValue(0);               // Should report success in error code.
 
-      // (2) With an invalid archive (boot class path has been prepended)
-      pb = ProcessTools.createJavaProcessBuilder(
-          "-Xbootclasspath/p:foo.jar",
-          "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa",
-          "-XX:+PrintSharedArchiveAndExit", "-version");
-      output = new OutputAnalyzer(pb.start());
-      output.shouldContain("archive is invalid");
-      output.shouldNotContain("java version");     // Should not print JVM version
-      output.shouldHaveExitValue(1);               // Should report failure in error code.
-
-      pb = ProcessTools.createJavaProcessBuilder(
-          "-Xbootclasspath/p:foo.jar",
-          "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa",
-          "-XX:+PrintSharedArchiveAndExit");
-      output = new OutputAnalyzer(pb.start());
-      output.shouldContain("archive is invalid");
-      output.shouldNotContain("Usage:");           // Should not print JVM help message
-      output.shouldHaveExitValue(1);               // Should report failure in error code.
     } catch (RuntimeException e) {
       e.printStackTrace();
       output.shouldContain("Unable to use shared archive");
--- a/test/runtime/Unsafe/RangeCheck.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/Unsafe/RangeCheck.java	Wed Jan 28 05:49:24 2015 -0800
@@ -26,6 +26,7 @@
  * @bug 8001071
  * @summary Add simple range check into VM implemenation of Unsafe access methods
  * @library /testlibrary
+ * @run main RangeCheck
  */
 
 import com.oracle.java.testlibrary.*;
@@ -44,6 +45,7 @@
                 "-Xmx32m",
                 "-XX:-TransmitErrorReport",
                 "-XX:-InlineUnsafeOps", // The compiler intrinsics doesn't have the assert
+                "-XX:AddModuleExports=java.base/sun.misc",
                 DummyClassWithMainRangeCheck.class.getName());
 
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
--- a/test/runtime/contended/Basic.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/contended/Basic.java	Wed Jan 28 05:49:24 2015 -0800
@@ -43,7 +43,7 @@
  * @bug     8003985
  * @summary Support Contended Annotation - JEP 142
  *
- * @run main/othervm -XX:-RestrictContended Basic
+ * @run main/othervm -XX:-RestrictContended -XX:AddModuleExports=java.base/sun.misc Basic
  */
 public class Basic {
 
--- a/test/runtime/contended/DefaultValue.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/contended/DefaultValue.java	Wed Jan 28 05:49:24 2015 -0800
@@ -43,7 +43,7 @@
  * @bug     8014509
  * @summary \@Contended: explicit default value behaves differently from the implicit value
  *
- * @run main/othervm -XX:-RestrictContended DefaultValue
+ * @run main/othervm -XX:-RestrictContended -XX:AddModuleExports=java.base/sun.misc DefaultValue
  */
 public class DefaultValue {
 
--- a/test/runtime/contended/Inheritance1.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/contended/Inheritance1.java	Wed Jan 28 05:49:24 2015 -0800
@@ -43,7 +43,7 @@
  * @bug     8012939
  * @summary \@Contended doesn't work correctly with inheritance
  *
- * @run main/othervm -XX:-RestrictContended Inheritance1
+ * @run main/othervm -XX:-RestrictContended -XX:AddModuleExports=java.base/sun.misc Inheritance1
  */
 public class Inheritance1 {
 
--- a/test/runtime/finalStatic/FinalStatic.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/finalStatic/FinalStatic.java	Wed Jan 28 05:49:24 2015 -0800
@@ -25,7 +25,7 @@
  * @test
  * @bug 8028553
  * @summary Test that VerifyError is not thrown when 'overriding' a static method.
- * @run main FinalStatic
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm FinalStatic
  */
 
 import java.lang.reflect.*;
--- a/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java	Wed Jan 28 05:49:24 2015 -0800
@@ -26,7 +26,7 @@
  * @test
  * @bug 8032010
  * @summary method lookup on an abstract method in a concrete class should be successful
- * @run main TestConcreteClassWithAbstractMethod
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestConcreteClassWithAbstractMethod
  */
 
 import jdk.internal.org.objectweb.asm.ClassWriter;
--- a/test/runtime/verifier/OverriderMsg.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/verifier/OverriderMsg.java	Wed Jan 28 05:49:24 2015 -0800
@@ -33,7 +33,7 @@
  * @bug 8026894
  * @library /testlibrary
  * @compile -XDignore.symbol.file OverriderMsg.java
- * @run main/othervm OverriderMsg
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm OverriderMsg
  */
 
 // This test checks that the super class name is included in the message when
--- a/test/runtime/verifier/TestANewArray.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/verifier/TestANewArray.java	Wed Jan 28 05:49:24 2015 -0800
@@ -35,10 +35,10 @@
  * @summary Test that anewarray bytecode is valid only if it specifies 255 or fewer dimensions.
  * @library /testlibrary
  * @compile -XDignore.symbol.file TestANewArray.java
- * @run main/othervm TestANewArray 49
- * @run main/othervm TestANewArray 50
- * @run main/othervm TestANewArray 51
- * @run main/othervm TestANewArray 52
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestANewArray 49
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestANewArray 50
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestANewArray 51
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestANewArray 52
  */
 
 /*
--- a/test/runtime/verifier/TestMultiANewArray.java	Mon Jan 26 17:03:46 2015 -0500
+++ b/test/runtime/verifier/TestMultiANewArray.java	Wed Jan 28 05:49:24 2015 -0800
@@ -33,10 +33,10 @@
  * @bug 8038076
  * @library /testlibrary
  * @compile -XDignore.symbol.file TestMultiANewArray.java
- * @run main/othervm TestMultiANewArray 49
- * @run main/othervm TestMultiANewArray 50
- * @run main/othervm TestMultiANewArray 51
- * @run main/othervm TestMultiANewArray 52
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestMultiANewArray 49
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestMultiANewArray 50
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestMultiANewArray 51
+ * @run main/othervm -XX:AddModuleExports=java.base/jdk.internal.org.objectweb.asm TestMultiANewArray 52
  */
 
 public class TestMultiANewArray {