test/java/rmi/transport/checkFQDN/CheckFQDN.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 32,41 **** --- 32,42 ---- * * @author Laird Dornin * * @library ../../testlibrary * @build CheckFQDN CheckFQDNClient CheckFQDN_Stub TellServerName + * @build TestLibrary * @run main/othervm/timeout=120 CheckFQDN */ /** * Get the hostname used by rmi using different rmi properities:
*** 61,71 **** * Export a remote object through which the exec'ed client vm can * inform the main test what its host name is. */ public class CheckFQDN extends UnicastRemoteObject implements TellServerName { ! static String propertyBeingTested = null; static String propertyBeingTestedValue = null; public static void main(String args[]) { --- 62,72 ---- * Export a remote object through which the exec'ed client vm can * inform the main test what its host name is. */ public class CheckFQDN extends UnicastRemoteObject implements TellServerName { ! public static int REGISTRY_PORT =-1; static String propertyBeingTested = null; static String propertyBeingTestedValue = null; public static void main(String args[]) {
*** 75,86 **** checkFQDN = new CheckFQDN(); System.err.println ("\nRegression test for bug/rfe 4115683\n"); ! Registry registry = java.rmi.registry.LocateRegistry. ! createRegistry(TestLibrary.REGISTRY_PORT); registry.bind("CheckFQDN", checkFQDN); /* test the host name scheme in different environments.*/ testProperty("java.rmi.server.useLocalHostname", "true", ""); testProperty("java.rmi.server.hostname", "thisIsJustAnRMITest", ""); --- 76,87 ---- checkFQDN = new CheckFQDN(); System.err.println ("\nRegression test for bug/rfe 4115683\n"); ! Registry registry = TestLibrary.createRegistryOnUnusedPort(); ! REGISTRY_PORT = TestLibrary.getRegistryPort(registry); registry.bind("CheckFQDN", checkFQDN); /* test the host name scheme in different environments.*/ testProperty("java.rmi.server.useLocalHostname", "true", ""); testProperty("java.rmi.server.hostname", "thisIsJustAnRMITest", "");
*** 115,125 **** } JavaVM jvm = new JavaVM("CheckFQDNClient", propOption + property + equal + ! propertyValue + extraProp, ""); propertyBeingTested=property; propertyBeingTestedValue=propertyValue; --- 116,128 ---- } JavaVM jvm = new JavaVM("CheckFQDNClient", propOption + property + equal + ! propertyValue + extraProp + ! " -Drmi.registry.port=" + ! REGISTRY_PORT, ""); propertyBeingTested=property; propertyBeingTestedValue=propertyValue;