GeneralWin32.java revision 2362
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This code is free software; you can redistribute it and/or modify it
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * under the terms of the GNU General Public License version 2 only, as
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * published by the Free Software Foundation.
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews * This code is distributed in the hope that it will be useful, but WITHOUT
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * version 2 for more details (a copy is included in the LICENSE file that
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * accompanied this code).
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * You should have received a copy of the GNU General Public License version
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * 2 along with this work; if not, write to the Free Software Foundation,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * or visit www.oracle.com if you need additional information or have any
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * questions.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein @bug 4032066 4039597 4046914 4054511 4065189 4109131 4875229
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein @summary General exhaustive test of win32 pathname handling
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein @author Mark Reinhold
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein @build General GeneralWin32
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein @run main/timeout=600 GeneralWin32
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * Hardwired UNC pathnames used for testing
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * This test attempts to use the host and share names defined in this class
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * to test UNC pathnames. The test will not fail if the host or share
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * don't exist, but it will print a warning saying that it was unable to
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein * test UNC pathnames completely.
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews private static final String EXISTENT_UNC_HOST = "pc-cup01";
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews private static final String EXISTENT_UNC_SHARE = "pcdist";
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews private static final String NONEXISTENT_UNC_HOST = "non-existent-unc-host";
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews private static final String NONEXISTENT_UNC_SHARE = "bogus-share";
7ae9399897c55d35cb6764277bce4b91d052e0dcEvan Hunt /* Pathnames relative to working directory */
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein private static void checkCaseLookup(String ud) throws IOException {
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein /* Use long names here to avoid 8.3 format, which Samba servers often
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews force to lowercase */
if (!d.mkdirs()) {
o.close();
o.close();
f.getCanonicalPath();
} catch (IOException x) {
private static char findInactiveDrive() {
private static char findActiveDrive() {
throws Exception
ensureNon(s);