< prev index next >

test/java/rmi/Naming/LookupIPv6.java

Print this page




   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  */
  23 
  24 /* @test
  25  * @summary Ensure that java.rmi.Naming.lookup can handle URLs containing
  26  *          IPv6 addresses.
  27  * @bug 4402708
  28  * @library ../testlibrary




  29  * @build TestLibrary
  30  * @run main/othervm -Djava.net.preferIPv6Addresses=true LookupIPv6
  31  */
  32 
  33 import java.net.InetAddress;
  34 import java.net.Inet6Address;
  35 import java.net.MalformedURLException;
  36 import java.rmi.Naming;
  37 import java.rmi.registry.LocateRegistry;
  38 import java.rmi.registry.Registry;
  39 
  40 public class LookupIPv6 {
  41     public static void main(String[] args) throws Exception {
  42         // use loopback IPv6 address to avoid lengthy socket connection delays
  43         String[] urls = {
  44             "rmi://[0000:0000:0000:0000:0000:0000:0000:0001]/foo",
  45             "//[0:0:0:0:0:0:0:1]:88/foo",
  46             "rmi://[0::0:0:0:1]/foo:bar",
  47             "//[::1]:88"
  48         };




   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  */
  23 
  24 /* @test
  25  * @summary Ensure that java.rmi.Naming.lookup can handle URLs containing
  26  *          IPv6 addresses.
  27  * @bug 4402708
  28  * @library ../testlibrary
  29  * @modules java.rmi/sun.rmi.registry
  30  *          java.rmi/sun.rmi.server
  31  *          java.rmi/sun.rmi.transport
  32  *          java.rmi/sun.rmi.transport.tcp
  33  * @build TestLibrary
  34  * @run main/othervm -Djava.net.preferIPv6Addresses=true LookupIPv6
  35  */
  36 
  37 import java.net.InetAddress;
  38 import java.net.Inet6Address;
  39 import java.net.MalformedURLException;
  40 import java.rmi.Naming;
  41 import java.rmi.registry.LocateRegistry;
  42 import java.rmi.registry.Registry;
  43 
  44 public class LookupIPv6 {
  45     public static void main(String[] args) throws Exception {
  46         // use loopback IPv6 address to avoid lengthy socket connection delays
  47         String[] urls = {
  48             "rmi://[0000:0000:0000:0000:0000:0000:0000:0001]/foo",
  49             "//[0:0:0:0:0:0:0:1]:88/foo",
  50             "rmi://[0::0:0:0:1]/foo:bar",
  51             "//[::1]:88"
  52         };


< prev index next >