langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java
author ykantser
Wed, 25 Mar 2015 15:22:45 +0000
changeset 30331 f07d88b6243c
parent 24399 af1a0220d0fa
child 30730 d3ce7619db2c
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17545
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
     1
/*
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 19119
diff changeset
     2
 * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
17545
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}
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    28
 * @library  ../lib
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    29
 * @build    JavadocTester
17545
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
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    35
    public static void main(String... args) throws Exception {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    36
        TestLiteralCodeInPre tester = new TestLiteralCodeInPre();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    37
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    38
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    39
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    40
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    41
    void test() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    42
        javadoc("-d", "out",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    43
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    44
                "-Xdoclint:none",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    45
                "pkg");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
        checkExit(Exit.OK);
17545
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    47
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    48
        checkOutput("pkg/Test.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    49
                "no_pre()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    50
                + "<div class=\"block\">abc<code>def</code>ghi</div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    51
                "no_pre_extra_whitespace()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    52
                + "<div class=\"block\">abc<code>def  </code>ghi</div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    53
                "in_pre()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    54
                + "<div class=\"block\"><pre> abc<code>  def  </code>ghi</pre></div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    55
                "pre_after_text()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    56
                + "<div class=\"block\">xyz <pre> abc<code>  def  </code>ghi</pre></div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
                "after_pre()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    58
                + "<div class=\"block\">xyz <pre> pqr </pre> abc<code>def  </code>ghi</div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    59
                "back_in_pre()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    60
                + "<div class=\"block\">xyz <pre> pqr </pre> mno <pre> abc<code>  def  </code>ghi</pre></div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    61
                "typical_usage_code()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    62
                + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    63
                + " Example:  <pre><code>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    64
                + "   line 1 &lt;T&gt; void m(T t) {\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    65
                + "   line 2     // do something with T\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    66
                + "   line 3 }\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    67
                + " </code></pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    68
                + " and so it goes.</div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    69
                "typical_usage_literal()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    70
                + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    71
                + " Example:  <pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    72
                + "   line 1 &lt;T&gt; void m(T t) {\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    73
                + "   line 2     // do something with T\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    74
                + "   line 3 }\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    75
                + " </pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    76
                + " and so it goes.</div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    77
                "recommended_usage_literal()</pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    78
                + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    79
                + " Example:  <pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    80
                + "   line 1 &lt;T&gt; void m(T t) {\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    81
                + "   line 2     // do something with T\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    82
                + "   line 3 } </pre>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    83
                + " and so it goes.</div>");
17545
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    84
    }
bfd4d1aa16ae 8002387: Improve rendered HTML formatting for {@code}
jjg
parents:
diff changeset
    85
}