JDK-8172347 : Refactoring src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java to improve testability of rmiregistry
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.rmi
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-01-06
  • Updated: 2017-04-28
  • Resolved: 2017-01-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b153Fixed
Related Reports
Relates :  
Description
It's hard to test rmiregistry and avoid "port in use" failure. Need to refactor RegistryImpl, to improve the testability.
To improve the testability of RMI, adds the method "launch", so in a subprocess of tests it could simulate rmiregistry by calling this method, then retrieve the information of returned RegistryImpl and pass back to tests, for example, get the exact port where rmiregistry is listening and pass it back to tests, this is useful when input port is 0.
Comments
As Roger suggested "Refactoring of RegistryImpl Main should be clean and clearly separated.", so separate this enhancement from JDK-8172314.
09-01-2017