changeset 9206:97dc93591ae7

8031179: update RMI tests to declare othervm explicitly Summary: The /othervm declaration should be added to all the RMI tests and the RMI directories removed from the othervm.dirs property Reviewed-by: smarks
author ewang
date Wed, 29 Jan 2014 22:18:46 -0800
parents b381b2173ce4
children d04102f69d46 e2c7135e9b2f
files test/TEST.ROOT test/java/rmi/MarshalledObject/compare/Compare.java test/java/rmi/MarshalledObject/compare/HashCode.java test/java/rmi/Naming/DefaultRegistryPort.java test/java/rmi/Naming/LookupIPv6.java test/java/rmi/Naming/LookupNameWithColon.java test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java test/sun/rmi/rmic/RMIGenerator/RmicDefault.java
diffstat 10 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/test/TEST.ROOT	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/TEST.ROOT	Wed Jan 29 22:18:46 2014 -0800
@@ -5,7 +5,7 @@
 keys=2d dnd i18n
 
 # Tests that must run in othervm mode
-othervm.dirs=java/awt java/beans java/rmi javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces sun/rmi
+othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces
 
 # Tests that cannot run concurrently
 exclusiveAccess.dirs=java/rmi/Naming java/util/Currency java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi
--- a/test/java/rmi/MarshalledObject/compare/Compare.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/java/rmi/MarshalledObject/compare/Compare.java	Wed Jan 29 22:18:46 2014 -0800
@@ -29,7 +29,7 @@
  *          not involved in location should be compared.
  * @author Ken Arnold
  *
- * @run main Compare 11 annotatedRef
+ * @run main/othervm Compare 11 annotatedRef
  */
 
 import java.rmi.MarshalledObject;
--- a/test/java/rmi/MarshalledObject/compare/HashCode.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/java/rmi/MarshalledObject/compare/HashCode.java	Wed Jan 29 22:18:46 2014 -0800
@@ -27,7 +27,7 @@
  * @summary MarshalledObject with null throws NullPointerException
  * @author Ken Arnold
  *
- * @run main HashCode 11 annotatedRef
+ * @run main/othervm HashCode 11 annotatedRef
  */
 
 import java.rmi.MarshalledObject;
--- a/test/java/rmi/Naming/DefaultRegistryPort.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/java/rmi/Naming/DefaultRegistryPort.java	Wed Jan 29 22:18:46 2014 -0800
@@ -28,7 +28,7 @@
  * @author Dana Burns
  * @library ../testlibrary
  * @build TestLibrary
- * @run main DefaultRegistryPort
+ * @run main/othervm DefaultRegistryPort
  */
 
 /*
--- a/test/java/rmi/Naming/LookupIPv6.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/java/rmi/Naming/LookupIPv6.java	Wed Jan 29 22:18:46 2014 -0800
@@ -25,7 +25,8 @@
  * @summary Ensure that java.rmi.Naming.lookup can handle URLs containing
  *          IPv6 addresses.
  * @bug 4402708
- *
+ * @library ../testlibrary
+ * @build TestLibrary
  * @run main/othervm -Djava.net.preferIPv6Addresses=true LookupIPv6
  */
 
@@ -62,17 +63,19 @@
          * an Inet6Address since this test is run with
          * -Djava.net.preferIPv6Addresses=true.
          */
+        int port = TestLibrary.getUnusedRandomPort();
         InetAddress localAddr = InetAddress.getAllByName(null)[0];
         if (localAddr instanceof Inet6Address) {
             System.out.println("IPv6 detected");
             Registry reg;
             try {
-                reg = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
+                reg = LocateRegistry.createRegistry(port);
             } catch (Exception ex) {
                 reg = LocateRegistry.getRegistry();
             }
             reg.rebind("foo", reg);
-            Naming.lookup("rmi://[" + localAddr.getHostAddress() + "]/foo");
+            Naming.lookup(String.format("rmi://[%s]:%d/foo",
+                          localAddr.getHostAddress(), port));
         }
     }
 }
--- a/test/java/rmi/Naming/LookupNameWithColon.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/java/rmi/Naming/LookupNameWithColon.java	Wed Jan 29 22:18:46 2014 -0800
@@ -28,7 +28,7 @@
  *
  * @library ../testlibrary
  * @build TestLibrary
- * @run main LookupNameWithColon
+ * @run main/othervm LookupNameWithColon
  */
 
 import java.rmi.Naming;
--- a/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java	Wed Jan 29 22:18:46 2014 -0800
@@ -28,7 +28,7 @@
  * @author Dana Burns
  * @library ../../testlibrary
  * @build TestLibrary Legal LegalRegistryNames_Stub
- * @run main LegalRegistryNames
+ * @run main/othervm LegalRegistryNames
  */
 
 import java.net.InetAddress;
--- a/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java	Wed Jan 29 22:18:46 2014 -0800
@@ -25,6 +25,8 @@
  * @test
  * @bug 4252236
  * @summary ActivationGroupDesc should not do early binding of default classname
+ *          This test doesn't need to run with othervm option as all it does is
+ *          create an ActivationGroupDesc instance, which has no side effects
  * @author Laird Dornin
  *
  * @library ../../../testlibrary
--- a/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java	Wed Jan 29 22:18:46 2014 -0800
@@ -30,7 +30,7 @@
  * @bug 6597112
  * @summary GC'ing objects whilst being exported to RMI should not cause exceptions
  * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
- * @run main GcDuringExport
+ * @run main/othervm GcDuringExport
  */
 
 import java.rmi.Remote;
--- a/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java	Wed Jan 29 22:18:46 2014 -0800
@@ -28,7 +28,7 @@
  * @library ../../../../java/rmi/testlibrary
  *
  * @build StreamPipe
- * @run main RmicDefault
+ * @run main/othervm RmicDefault
  */
 
 /*