jdk/test/java/rmi/testlibrary/TestLibrary.java
changeset 29274 c44678403857
parent 28294 d53052d43e13
--- a/jdk/test/java/rmi/testlibrary/TestLibrary.java	Thu Mar 05 14:54:07 2015 +0100
+++ b/jdk/test/java/rmi/testlibrary/TestLibrary.java	Thu Mar 05 17:04:47 2015 +0000
@@ -413,6 +413,16 @@
     }
 
     /**
+     * Creates an RMI {@link Registry} on an ephemeral port.
+     *
+     * @returns an RMI Registry
+     * @throws RemoteException if there was a problem creating a Registry.
+     */
+    public static Registry createRegistryOnEphemeralPort() throws RemoteException {
+        return LocateRegistry.createRegistry(0);
+    }
+
+    /**
      * Returns the port number the RMI {@link Registry} is running on.
      *
      * @param registry the registry to find the port of.