langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java
author rriggs
Thu, 06 Feb 2014 11:01:27 -0500
changeset 22938 dde13f2c082d
parent 19119 3c2e9a2bbed6
child 23971 f5ff1f5a8dee
permissions -rw-r--r--
8033565: Remove unused nativeNewStringPlatform Summary: Remove also nativeGetStringPlatformChars Reviewed-by: mchung, dholmes, alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17545
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     1
/*
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     2
 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     4
 *
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     8
 *
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    13
 * accompanied this code).
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    14
 *
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    18
 *
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    21
 * questions.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    22
 */
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    23
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    24
/*
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    25
 * @test
19119
3c2e9a2bbed6 8014636: TestLiteralCodeInPre fails on windows
jjg
parents: 17545
diff changeset
    26
 * @bug      8002387 8014636
17545
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    27
 * @summary  Improve rendered HTML formatting for {@code}
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    28
 * @library  ../lib/
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    29
 * @build    JavadocTester TestLiteralCodeInPre
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    30
 * @run main TestLiteralCodeInPre
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    31
 */
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    32
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    33
public class TestLiteralCodeInPre extends JavadocTester {
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    34
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    35
    //Test information.
19119
3c2e9a2bbed6 8014636: TestLiteralCodeInPre fails on windows
jjg
parents: 17545
diff changeset
    36
    private static final String BUG_ID = "8002387-8014636";
17545
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    37
    private static final String OUTPUT_DIR = BUG_ID;
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    38
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    39
    //Javadoc arguments.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    40
    private static final String[] ARGS = new String[] {
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    41
        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-Xdoclint:none", "pkg"
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    42
    };
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    43
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    44
    //Input for string search tests.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    45
    private static final String[][] TEST = {
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    46
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    47
            "no_pre()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    48
            "<div class=\"block\">abc<code>def</code>ghi</div>" },
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    49
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    50
            "no_pre_extra_whitespace()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    51
            "<div class=\"block\">abc<code>def  </code>ghi</div>" },
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    52
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    53
            "in_pre()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    54
            "<div class=\"block\"><pre> abc<code>  def  </code>ghi</pre></div>" },
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    55
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    56
            "pre_after_text()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    57
            "<div class=\"block\">xyz <pre> abc<code>  def  </code>ghi</pre></div>" },
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    58
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    59
            "after_pre()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    60
            "<div class=\"block\">xyz <pre> pqr </pre> abc<code>def  </code>ghi</div>" },
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    61
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    62
            "back_in_pre()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    63
            "<div class=\"block\">xyz <pre> pqr </pre> mno <pre> abc<code>  def  </code>ghi</pre></div>" },
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    64
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    65
            "typical_usage_code()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    66
            "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit." + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    67
            " Example:  <pre><code>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    68
            "   line 1 &lt;T&gt; void m(T t) {" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    69
            "   line 2     // do something with T" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    70
            "   line 3 }" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    71
            " </code></pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    72
            " and so it goes.</div>" },
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    73
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    74
            "typical_usage_literal()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    75
            "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit." + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    76
            " Example:  <pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    77
            "   line 1 &lt;T&gt; void m(T t) {" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    78
            "   line 2     // do something with T" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    79
            "   line 3 }" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    80
            " </pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    81
            " and so it goes.</div>" },
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    82
        { BUG_ID + FS + "pkg" + FS + "Test.html",
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    83
            "recommended_usage_literal()</pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    84
            "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit." + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    85
            " Example:  <pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    86
            "   line 1 &lt;T&gt; void m(T t) {" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    87
            "   line 2     // do something with T" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    88
            "   line 3 } </pre>" + NL +
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    89
            " and so it goes.</div>" }
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    90
    };
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    91
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    92
    private static final String[][] NEGATED_TEST = NO_TEST;
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    93
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    94
    /**
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    95
     * The entry point of the test.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    96
     * @param args the array of command line arguments.
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    97
     */
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    98
    public static void main(String[] args) {
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    99
        TestLiteralCodeInPre tester = new TestLiteralCodeInPre();
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   100
        run(tester, ARGS, TEST, NEGATED_TEST);
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   101
        tester.printSummary();
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   102
    }
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   103
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   104
    /**
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   105
     * {@inheritDoc}
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   106
     */
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   107
    public String getBugId() {
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   108
        return BUG_ID;
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   109
    }
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   110
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   111
    /**
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   112
     * {@inheritDoc}
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   113
     */
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   114
    public String getBugName() {
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   115
        return getClass().getName();
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   116
    }
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
   117
}