langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java
author robm
Tue, 19 Nov 2013 15:36:59 +0000
changeset 21816 1fa16478977c
parent 21026 b35314edf87a
child 23968 d67158b385dd
permissions -rw-r--r--
8022206: Intermittent test failures in java/lang/ProcessBuilder/Basic.java Reviewed-by: chegar, alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21026
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     1
/*
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     4
 *
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     8
 *
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    13
 * accompanied this code).
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    14
 *
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    18
 *
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    21
 * questions.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    22
 */
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    23
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    24
/*
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    25
 * @test
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    26
 * @bug 8016675
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    27
 * @summary Test for window title.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    28
 * @author Bhavesh Patel
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    29
 * @library ../lib/
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    30
 * @build JavadocTester TestWindowTitle
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    31
 * @run main TestWindowTitle
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    32
 */
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    33
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    34
public class TestWindowTitle extends JavadocTester {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    35
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    36
    private static final String BUG_ID = "8016675";
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    37
    private static final String WIN_TITLE =
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    38
            "Testing \"Window 'Title'\" with a \\ backslash and a / " +
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    39
            "forward slash and a \u00e8 unicode char also a    tab and also a " +
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    40
            "\t special character another \u0002 unicode)";
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    41
    private static final String[][] TEST = {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    42
        {BUG_ID + FS  + "overview-summary.html",
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    43
            "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " +
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    44
            "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " +
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    45
            "also a    tab and also a \\t special character another \\u0002 unicode))\";"
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    46
        },
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    47
    };
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    48
    private static final String[][] NEG_TEST = {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    49
        {BUG_ID + FS + "overview-summary.html",
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    50
            "parent.document.title=\"Overview (Testing \"Window \'Title\'\" " +
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    51
            "with a \\ backslash and a / forward slash and a \u00E8 unicode char " +
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    52
            "also a    tab and also a \t special character another \u0002 unicode))\";"
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    53
        },
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    54
    };
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    55
    private static final String[] ARGS = new String[]{
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    56
        "-d", BUG_ID, "-windowtitle", WIN_TITLE, "-sourcepath", SRC_DIR, "p1", "p2"
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    57
    };
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    58
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    59
    /**
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    60
     * The entry point of the test.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    61
     * @param args the array of command line arguments.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    62
     */
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    63
    public static void main(String[] args) {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    64
        TestWindowTitle tester = new TestWindowTitle();
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    65
        run(tester, ARGS, TEST, NEG_TEST);
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    66
        tester.printSummary();
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    67
    }
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    68
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    69
    /**
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    70
     * {@inheritDoc}
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    71
     */
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    72
    public String getBugId() {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    73
        return BUG_ID;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    74
    }
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    75
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    76
    /**
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    77
     * {@inheritDoc}
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    78
     */
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    79
    public String getBugName() {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    80
        return getClass().getName();
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    81
    }
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents:
diff changeset
    82
}