--- old/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java 2012-07-16 15:36:04.561581739 -0700 +++ new/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java 2012-07-16 15:36:04.285577345 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ * @build Hello * @build HelloImpl * @build HelloImpl_Stub + * @build TestLibrary * @build UseCustomSocketFactory * @build Compress * @run main/othervm/policy=security.policy/timeout=240 UseCustomSocketFactory @@ -58,6 +59,7 @@ System.out.println("\nRegression test for bug 4148850\n"); TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager"); + int registryPort = TestLibrary.getUnusedRandomPort(); try { impl = new HelloImpl(); @@ -67,7 +69,7 @@ * allow the rmiregistry to be secure. */ registry = LocateRegistry. - createRegistry(TestLibrary.REGISTRY_PORT, + createRegistry(registryPort, new Compress.CompressRMIClientSocketFactory(), new Compress.CompressRMIServerSocketFactory()); registry.rebind("/HelloServer", impl); @@ -77,8 +79,12 @@ TestLibrary.bomb("creating registry", e); } - JavaVM serverVM = new JavaVM("HelloImpl", "-Djava.security.policy=" + - TestParams.defaultPolicy, ""); + JavaVM serverVM = new JavaVM("HelloImpl", + "-Djava.security.policy=" + + TestParams.defaultPolicy + + " -Drmi.registry.port=" + + registryPort, + ""); try {