On 05/07/2012 22:22, Darryl Mocek wrote:
Hello core-libs. Please review this webrev to fix Bugs #7142596 and
7161503. Webrev can be found here:
http://cr.openjdk.java.net/~dmocek/7142596/webrev.02. This commit
fixes concurrency issues with the RMI tests.
- Added TestLibrary.createRegistryOnUnusedPort method. This creates
an RMIRegistry on an unused port. It will try up to 10 times before
giving up.
- Added a TestLibrary.getRegistryPort(Registry) method to get the port
number of the registry.
I don't have cycles to review this in any detail but what is the reason
for the "try up to 10 times". I thought the plan was to just use
LocateRegistry.createRegistry(0) and so use an ephemeral port.
Also one idea is to do:
public class TestRegistry extends Registry {
public static TestRegistry create() { ... }
public int port() { ... }
:
}
so that the tests can simply do:
TestRegistry reg = TestRegistry.create();
and then use reg.port() instead of TestLibrary.getRegistryPort
everywhere. It amounts to the same thing but may be a bit neater.
-Alan.