5740N/A * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @summary Endpoint hostnames should always be fully qualified or 0N/A * should be an ip address. When references to remote 0N/A * objects are passed outside of the local domain their 0N/A * endpoints may contain hostnames that are not fully 0N/A * qualified. Hence remote clients won't be able to contact 0N/A * the referenced remote obect. 0N/A * @author Laird Dornin 0N/A * @library ../../testlibrary 5551N/A * @build TestLibrary CheckFQDNClient CheckFQDN_Stub TellServerName 0N/A * Get the hostname used by rmi using different rmi properities: 0N/A * if set java.rmi.server.hostname, hostname should equal this 0N/A * if set java.rmi.server.useLocalHostname, hostname must contain a '.' 0N/A * if set no properties hostname should be an ipaddress. 0N/A * if set java.rmi.server.hostname, hostname should equal this 0N/A * property even if set java.rmi.server.useLocalHostname is true. 169N/A * Export a remote object through which the exec'ed client vm can 0N/A * inform the main test what its host name is. 169N/A /* test the host name scheme in different environments.*/ 169N/A " -Djava.rmi.server.useLocalHostname=true ");
0N/A * Spawn a vm and feed it a property which sets the client's rmi 5740N/A // create a client to tell checkFQDN what its rmi name is. 169N/A * Remote method to allow client vm to tell the main test what its 169N/A ":\n Client rmi server name does " +
169N/A "not equal the one specified " +
169N/A "by java.rmi.server.hostname: " +
169N/A /** use local host name, must contain a '.' */ 169N/A (
"java.rmi.server.useLocalHostname")) {
169N/A ":\nThe client servername contains no '.'");
169N/A // no propety set, must be ip address 169N/A " The client servername contains no '.'"+
169N/A "or is not an ip address");