/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5083594
* @summary Ensure that Naming.java correctly parses host names with '_' in
* them.
* @author Vinod Johnson
*
* @library ../testlibrary
* @build TestLibrary UnderscoreHost_Stub
*/
/*
* The socket factory captures the host name of the parsed URL, and
* then connects to the local host.
*/
throws IOException {
// Only set it the first time, subsequent DGC dirty calls
// will be local host
}
}
return new ServerSocket(port);
}
}
UnderscoreHost t = null;
try {
t = new UnderscoreHost();
/*
* This test is coded to pass whether java.net.URI obeys
* RFC 2396 or RFC 3986 (see 5085902, 6394131, etc.).
*
* If java.net.URI obeys RFC 3986, so host names may
* contain underscores, then the Naming.lookup invocation
* should succeed-- but the host actually connected to
* must equal HOSTNAME.
*/
throw new RuntimeException(
"java.rmi.Naming Parsing error:" +
}
} catch (MalformedURLException e) {
/*
* If java.net.URI obeys RFC 2396, so host names must not
* contain underscores, then the Naming.lookup invocation
* should throw MalformedURLException-- so this is OK.
*/
} catch (IOException ioe) {
} finally {
TestLibrary.unexport(t);
}
}
}