test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java

Print this page


   1 /*
   2  * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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  */


  28  * @author Dana Burns
  29  * @library ../../testlibrary
  30  * @build TestLibrary
  31  * @build Legal LegalRegistryNames LegalRegistryNames_Stub
  32  * @run main LegalRegistryNames
  33  */
  34 
  35 import java.net.InetAddress;
  36 import java.net.UnknownHostException;
  37 import java.rmi.Naming;
  38 import java.rmi.RemoteException;
  39 import java.rmi.Remote;
  40 import java.rmi.registry.LocateRegistry;
  41 import java.rmi.registry.Registry;
  42 import java.rmi.server.UnicastRemoteObject;
  43 import java.util.Enumeration;
  44 import java.util.Vector;
  45 
  46 /**
  47  * Ensure that all legal forms of Naming URLs operate with the
  48  * java.rmi.Naming interface


  49  */
  50 public class LegalRegistryNames extends UnicastRemoteObject
  51     implements Legal
  52 {
  53 
  54     public LegalRegistryNames() throws java.rmi.RemoteException {}
  55 
  56     public static void main(String args[]) throws RuntimeException {
  57 
  58         System.err.println("\nRegression test for bug/rfe 4254808\n");
  59 
  60         Registry registry = null;
  61         LegalRegistryNames legal = null;
  62 
  63         boolean oneFormFailed = false;
  64         String[] names = null;
  65         Vector legalForms = getLegalForms();
  66         Remote shouldFind = null;
  67 
  68         // create a registry and the test object


   1 /*
   2  * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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  */


  28  * @author Dana Burns
  29  * @library ../../testlibrary
  30  * @build TestLibrary
  31  * @build Legal LegalRegistryNames LegalRegistryNames_Stub
  32  * @run main LegalRegistryNames
  33  */
  34 
  35 import java.net.InetAddress;
  36 import java.net.UnknownHostException;
  37 import java.rmi.Naming;
  38 import java.rmi.RemoteException;
  39 import java.rmi.Remote;
  40 import java.rmi.registry.LocateRegistry;
  41 import java.rmi.registry.Registry;
  42 import java.rmi.server.UnicastRemoteObject;
  43 import java.util.Enumeration;
  44 import java.util.Vector;
  45 
  46 /**
  47  * Ensure that all legal forms of Naming URLs operate with the
  48  * java.rmi.Naming interface.  This test requires using the default RMI Registry
  49  * port as it tests all of the RMI naming URL's, including the ones which do not
  50  * take a port (and therefore uses the default port).
  51  */
  52 public class LegalRegistryNames extends UnicastRemoteObject
  53     implements Legal
  54 {
  55 
  56     public LegalRegistryNames() throws java.rmi.RemoteException {}
  57 
  58     public static void main(String args[]) throws RuntimeException {
  59 
  60         System.err.println("\nRegression test for bug/rfe 4254808\n");
  61 
  62         Registry registry = null;
  63         LegalRegistryNames legal = null;
  64 
  65         boolean oneFormFailed = false;
  66         String[] names = null;
  67         Vector legalForms = getLegalForms();
  68         Remote shouldFind = null;
  69 
  70         // create a registry and the test object