8031179: update RMI tests to declare othervm explicitly
authorewang
Wed, 29 Jan 2014 22:18:46 -0800
changeset 22614 2e2f77dc2599
parent 22613 4492f0cfdd38
child 22615 e929c13f8d11
child 22616 2b4c9efdf2d7
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
jdk/test/TEST.ROOT
jdk/test/java/rmi/MarshalledObject/compare/Compare.java
jdk/test/java/rmi/MarshalledObject/compare/HashCode.java
jdk/test/java/rmi/Naming/DefaultRegistryPort.java
jdk/test/java/rmi/Naming/LookupIPv6.java
jdk/test/java/rmi/Naming/LookupNameWithColon.java
jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java
jdk/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java
jdk/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java
jdk/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java
--- a/jdk/test/TEST.ROOT	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/java/rmi/MarshalledObject/compare/Compare.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/java/rmi/MarshalledObject/compare/HashCode.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/java/rmi/Naming/DefaultRegistryPort.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/java/rmi/Naming/LookupIPv6.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/java/rmi/Naming/LookupNameWithColon.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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/jdk/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java	Wed Jan 29 14:33:07 2014 -0800
+++ b/jdk/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
  */
 
 /*