test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java

Wed, 08 Oct 2014 14:16:40 -0700

author
asaha
date
Wed, 08 Oct 2014 14:16:40 -0700
changeset 2586
f5e5ca7505e2
parent 1911
80e75aa6a707
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Merge

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

mercurial