jdk/test/java/io/pathNames/GeneralWin32.java
author ewang
Tue, 28 May 2013 22:22:48 -0700
changeset 17726 4aff99bf471b
parent 7668 d4a77089c587
child 17924 c4e51dc609b1
permissions -rw-r--r--
8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently Reviewed-by: dxu, alanb Contributed-by: yiming.wang@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
     2
 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/* @test
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    25
   @bug 4032066 4039597 4046914 4054511 4065189 4109131 4875229 6983520 8009258
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
   @summary General exhaustive test of win32 pathname handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
   @author Mark Reinhold
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
   @build General GeneralWin32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
   @run main/timeout=600 GeneralWin32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
public class GeneralWin32 extends General {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
     * Hardwired UNC pathnames used for testing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
     * This test attempts to use the host and share names defined in this class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * to test UNC pathnames.  The test will not fail if the host or share
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     * don't exist, but it will print a warning saying that it was unable to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * test UNC pathnames completely.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    private static final String EXISTENT_UNC_HOST = "pc-cup01";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    private static final String EXISTENT_UNC_SHARE = "pcdist";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    private static final String NONEXISTENT_UNC_HOST = "non-existent-unc-host";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    private static final String NONEXISTENT_UNC_SHARE = "bogus-share";
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    50
    private static final int DEPTH = 2;
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    51
    private static String baseDir = null;
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    52
    private static String userDir = null;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    /* Pathnames relative to working directory */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    56
    private static void checkCaseLookup() throws IOException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        /* Use long names here to avoid 8.3 format, which Samba servers often
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
           force to lowercase */
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    59
        String relative = baseDir.substring(userDir.length() + 1);
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    60
        File d1 = new File(relative, "XyZzY0123");
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    61
        File d2 = new File(d1, "FOO_bar_BAZ");
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    62
        File f = new File(d2, "GLORPified");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        if (!f.exists()) {
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    64
            if (!d2.exists()) {
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    65
                if (!d2.mkdirs()) {
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    66
                    throw new RuntimeException("Can't create directory " + d2);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            OutputStream o = new FileOutputStream(f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            o.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        }
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    72
        File f2 = new File(d2.getParent(), "mumble"); /* For later ud tests */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        if (!f2.exists()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            OutputStream o = new FileOutputStream(f2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
            o.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        /* Computing the canonical path of a Win32 file should expose the true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
           case of filenames, rather than just using the input case */
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    80
        File y = new File(userDir, f.getPath());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        String ans = y.getPath();
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    82
        check(ans, relative + "\\" + "XyZzY0123\\FOO_bar_BAZ\\GLORPified");
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    83
        check(ans, relative + "\\" + "xyzzy0123\\foo_bar_baz\\glorpified");
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    84
        check(ans, relative + "\\" + "XYZZY0123\\FOO_BAR_BAZ\\GLORPIFIED");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    private static void checkWild(File f) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
            f.getCanonicalPath();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        } catch (IOException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        throw new Exception("Wildcard path not rejected: " + f);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    96
    private static void checkWildCards() throws Exception {
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
    97
        File d = new File(baseDir).getCanonicalFile();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        checkWild(new File(d, "*.*"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        checkWild(new File(d, "*.???"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        checkWild(new File(new File(d, "*.*"), "foo"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    private static void checkRelativePaths() throws Exception {
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   104
        checkCaseLookup();
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   105
        checkWildCards();
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   106
        String relative = baseDir.substring(userDir.length() + 1);
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   107
        checkNames(3, true, baseDir.toString(), relative);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    /* Pathnames with drive specifiers */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    private static char findInactiveDrive() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        for (char d = 'Z'; d >= 'E'; d--) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            File df = new File(d + ":\\");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            if (!df.exists()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                return d;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        throw new RuntimeException("Can't find an inactive drive");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    private static char findActiveDrive() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        for (char d = 'C'; d <= 'Z'; d--) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            File df = new File(d + ":\\");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            if (df.exists()) return d;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        throw new RuntimeException("Can't find an active drive");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    private static void checkDrive(int depth, char drive, boolean exists)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        throws Exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        String d = drive + ":";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        File df = new File(d);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        String ans = exists ? df.getAbsolutePath() : d;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        if (!ans.endsWith("\\"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            ans = ans + "\\";
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   139
        String relative = baseDir.substring(userDir.length() + 1);
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   140
        checkNames(depth, false, ans + relative, d + relative);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    private static void checkDrivePaths() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        checkDrive(2, findActiveDrive(), true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        checkDrive(2, findInactiveDrive(), false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    /* UNC pathnames */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    private static void checkUncPaths() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        String s = ("\\\\" + NONEXISTENT_UNC_HOST
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
                    + "\\" + NONEXISTENT_UNC_SHARE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        ensureNon(s);
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   155
        checkSlashes(DEPTH, false, s, s);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        s = "\\\\" + EXISTENT_UNC_HOST + "\\" + EXISTENT_UNC_SHARE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        if (!(new File(s)).exists()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            System.err.println("WARNING: " + s +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                               " does not exist, unable to test UNC pathnames");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   164
        checkSlashes(DEPTH, false, s, s);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        if (File.separatorChar != '\\') {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            /* This test is only valid on win32 systems */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        if (args.length > 0) debug = true;
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   174
        userDir = System.getProperty("user.dir");
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   175
        baseDir = initTestData(6);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        checkRelativePaths();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        checkDrivePaths();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        checkUncPaths();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
17726
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   181
    private static String initTestData(int maxDepth) throws IOException {
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   182
        File parent = new File(System.getProperty("user.dir"));
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   183
        String baseDir = null;
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   184
        maxDepth = maxDepth < DEPTH + 2 ? DEPTH + 2 : maxDepth;
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   185
        for (int i = 0; i < maxDepth; i ++) {
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   186
            File dir1 = new File(parent, gensym());
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   187
            dir1.mkdir();
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   188
            if (i != 0) {
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   189
                File dir2 = new File(parent, gensym());
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   190
                dir2.mkdir();
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   191
                File f1 = new File(parent, gensym());
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   192
                f1.createNewFile();
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   193
                File f2 = new File(parent, gensym());
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   194
                f2.createNewFile();
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   195
            }
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   196
            if (i == DEPTH + 1) {
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   197
                baseDir = dir1.getAbsolutePath();
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   198
            }
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   199
            parent = dir1;
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   200
        }
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   201
        return baseDir;
4aff99bf471b 8009258: TEST_BUG:java/io/pathNames/GeneralWin32.java fails intermittently
ewang
parents: 7668
diff changeset
   202
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
}