langtools/test/jdk/javadoc/tool/T4696488.java
changeset 45417 f7479ee8de69
parent 40310 a979695d72a1
equal deleted inserted replaced
45416:0d8bb33bdfa7 45417:f7479ee8de69
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    28  * @author  Jesse Glick
    28  * @author  Jesse Glick
    29  * @modules jdk.javadoc/jdk.javadoc.internal.doclets.toolkit
    29  * @modules jdk.javadoc/jdk.javadoc.internal.doclets.toolkit
    30  * @run main T4696488 T4696488.java
    30  * @run main T4696488 T4696488.java
    31  */
    31  */
    32 
    32 
    33 import jdk.javadoc.internal.doclets.toolkit.Configuration;
    33 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
    34 
    34 
    35 public class T4696488 {
    35 public class T4696488 {
    36 
    36 
    37     public static void main(String... args) {
    37     public static void main(String... args) {
    38         System.setProperty("file.separator", "/");
    38         System.setProperty("file.separator", "/");
    47         assertAddTrailingFileSep("\\\\server\\share\\path\\to\\dir\\", "\\\\server\\share\\path\\to\\dir\\");
    47         assertAddTrailingFileSep("\\\\server\\share\\path\\to\\dir\\", "\\\\server\\share\\path\\to\\dir\\");
    48         assertAddTrailingFileSep("\\\\server\\share\\path\\to\\dir\\\\", "\\\\server\\share\\path\\to\\dir\\");
    48         assertAddTrailingFileSep("\\\\server\\share\\path\\to\\dir\\\\", "\\\\server\\share\\path\\to\\dir\\");
    49     }
    49     }
    50 
    50 
    51     private static void assertAddTrailingFileSep(String input, String expectedOutput) {
    51     private static void assertAddTrailingFileSep(String input, String expectedOutput) {
    52         String output = Configuration.addTrailingFileSep(input);
    52         String output = BaseConfiguration.addTrailingFileSep(input);
    53         if (!expectedOutput.equals(output)) {
    53         if (!expectedOutput.equals(output)) {
    54             throw new Error("expected " + expectedOutput + " but was " + output);
    54             throw new Error("expected " + expectedOutput + " but was " + output);
    55         }
    55         }
    56     }
    56     }
    57 }
    57 }