test/java/rmi/Naming/DefaultRegistryPort.java

Print this page




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 4251878
  27  * @summary change in default URL port causes regression in java.rmi.Naming
  28  * @author Dana Burns
  29  * @library ../testlibrary
  30  * @build TestLibrary
  31  * @run main DefaultRegistryPort
  32  */
  33 
  34 /*
  35  * Ensure that the default registry port for java.rmi.Naming URLs
  36  * is 1099. Test creates a registry on port 1099 and then does a
  37  * lookup with a Naming URL that uses the default port. Test fails
  38  * if the lookup yields a NotBoundException. If the registry could
  39  * not be created, a fallback strategy of using an existing one is
  40  * tried.
  41  */
  42 
  43 import java.rmi.Naming;
  44 import java.rmi.Remote;
  45 import java.rmi.registry.LocateRegistry;
  46 import java.rmi.registry.Registry;
  47 
  48 public class DefaultRegistryPort {
  49 
  50     public static void main(String args[]) {
  51 




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 4251878
  27  * @summary change in default URL port causes regression in java.rmi.Naming
  28  * @author Dana Burns
  29  * @library ../testlibrary
  30  * @build TestLibrary
  31  * @run main/othervm DefaultRegistryPort
  32  */
  33 
  34 /*
  35  * Ensure that the default registry port for java.rmi.Naming URLs
  36  * is 1099. Test creates a registry on port 1099 and then does a
  37  * lookup with a Naming URL that uses the default port. Test fails
  38  * if the lookup yields a NotBoundException. If the registry could
  39  * not be created, a fallback strategy of using an existing one is
  40  * tried.
  41  */
  42 
  43 import java.rmi.Naming;
  44 import java.rmi.Remote;
  45 import java.rmi.registry.LocateRegistry;
  46 import java.rmi.registry.Registry;
  47 
  48 public class DefaultRegistryPort {
  49 
  50     public static void main(String args[]) {
  51