--- old/test/java/rmi/Naming/LookupNameWithColon.java 2012-07-03 11:31:23.510554059 -0700 +++ new/test/java/rmi/Naming/LookupNameWithColon.java 2012-07-03 11:31:23.298550684 -0700 @@ -25,6 +25,9 @@ * @bug 4387038 * @summary Ensure that java.rmi.Naming.lookup functions properly for names * containing embedded ':' characters. + * + * @library ../testlibrary + * @build TestLibrary */ import java.rmi.Naming; @@ -39,14 +42,17 @@ }; Registry reg; + int port = -1; + try { - reg = LocateRegistry.createRegistry(Registry.REGISTRY_PORT); + reg = TestLibrary.createRegistryOnUnusedPort(); + port = TestLibrary.getRegistryPort(reg); } catch (Exception ex) { reg = LocateRegistry.getRegistry(); } for (int i = 0; i < names.length; i++) { reg.rebind(names[i], reg); - Naming.lookup("rmi://localhost/" + names[i]); + Naming.lookup("rmi://localhost:" + port + "/" + names[i]); } } }