test/langtools/jdk/javadoc/tool/T4696488.java
author bobv
Tue, 07 Nov 2017 10:30:53 -0500
changeset 47801 c7b50c23ea71
parent 47216 71c04702a3d5
permissions -rw-r--r--
8190283: Default heap sizing options select a MaxHeapSize larger than available physical memory in some cases Reviewed-by: tschatzl, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14061
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
     1
/*
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40310
diff changeset
     2
 * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
14061
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
     4
 *
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
     8
 *
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    13
 * accompanied this code).
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    14
 *
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    18
 *
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    21
 * questions.
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    22
 */
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    23
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    24
/**
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    25
 * @test
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    26
 * @bug     4696488
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    27
 * @summary javadoc doesn't handle UNC paths for destination directory
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    28
 * @author  Jesse Glick
40310
a979695d72a1 8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents: 35426
diff changeset
    29
 * @modules jdk.javadoc/jdk.javadoc.internal.doclets.toolkit
14061
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    30
 * @run main T4696488 T4696488.java
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    31
 */
40310
a979695d72a1 8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents: 35426
diff changeset
    32
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40310
diff changeset
    33
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
40310
a979695d72a1 8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents: 35426
diff changeset
    34
14061
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    35
public class T4696488 {
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    36
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    37
    public static void main(String... args) {
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    38
        System.setProperty("file.separator", "/");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    39
        assertAddTrailingFileSep("/path/to/dir", "/path/to/dir/");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    40
        assertAddTrailingFileSep("/path/to/dir/", "/path/to/dir/");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    41
        assertAddTrailingFileSep("/path/to/dir//", "/path/to/dir/");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    42
        System.setProperty("file.separator", "\\");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    43
        assertAddTrailingFileSep("C:\\path\\to\\dir", "C:\\path\\to\\dir\\");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    44
        assertAddTrailingFileSep("C:\\path\\to\\dir\\", "C:\\path\\to\\dir\\");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    45
        assertAddTrailingFileSep("C:\\path\\to\\dir\\\\", "C:\\path\\to\\dir\\");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    46
        assertAddTrailingFileSep("\\\\server\\share\\path\\to\\dir", "\\\\server\\share\\path\\to\\dir\\");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    47
        assertAddTrailingFileSep("\\\\server\\share\\path\\to\\dir\\", "\\\\server\\share\\path\\to\\dir\\");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    48
        assertAddTrailingFileSep("\\\\server\\share\\path\\to\\dir\\\\", "\\\\server\\share\\path\\to\\dir\\");
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    49
    }
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    50
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    51
    private static void assertAddTrailingFileSep(String input, String expectedOutput) {
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40310
diff changeset
    52
        String output = BaseConfiguration.addTrailingFileSep(input);
14061
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    53
        if (!expectedOutput.equals(output)) {
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    54
            throw new Error("expected " + expectedOutput + " but was " + output);
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    55
        }
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    56
    }
9ac68cf0048b 4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
diff changeset
    57
}