Wed, 18 Sep 2013 22:47:06 -0700
8024096: some javadoc tests may contain false positive results
Reviewed-by: jjg
1 /*
2 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
24 /*
25 * @test
26 * @bug 4496223 4496270 4618686 4720974 4812240 6253614 6253604
27 * @summary <DESC>
28 * @author jamieh
29 * @library ../lib/
30 * @build JavadocTester
31 * @build TestTagInheritence
32 * @run main TestTagInheritence
33 */
35 public class TestTagInheritence extends JavadocTester {
37 private static final String BUG_ID = "4496223-4496270-4618686-4720974-4812240-6253614-6253604";
38 private static final String[] ARGS = new String[] {
39 "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "firstSentence", "firstSentence2"
40 };
42 /**
43 * The entry point of the test.
44 * @param args the array of command line arguments.
45 */
46 public static void main(String[] args) {
47 String[][] tests = new String[42][2];
48 //Test bad inheritDoc tag warning.
49 tests[0][0]= WARNING_OUTPUT;
50 tests[0][1] = "warning - @inheritDoc used but testBadInheritDocTag() " +
51 "does not override or implement any method.";
53 //Test valid usage of inheritDoc tag.
54 for (int i = 1; i < tests.length-2; i++) {
55 tests[i][0] = BUG_ID + FS + "pkg" + FS + "TestTagInheritence.html";
56 tests[i][1] = "Test " + i + " passes";
57 }
59 //First sentence test (6253614)
60 tests[tests.length - 2][0] =BUG_ID + FS + "firstSentence" + FS +
61 "B.html";
62 tests[tests.length - 2][1] = "<div class=\"block\">First sentence.</div>";
64 //Another first sentence test (6253604)
65 tests[tests.length - 1][0] =BUG_ID + FS + "firstSentence2" + FS +
66 "C.html";
67 tests[tests.length - 1][1] = "<div class=\"block\">First sentence.</div>";
69 TestTagInheritence tester = new TestTagInheritence();
70 run(tester, ARGS, tests, NO_TEST);
71 tester.printSummary();
72 }
74 /**
75 * {@inheritDoc}
76 */
77 public String getBugId() {
78 return BUG_ID;
79 }
81 /**
82 * {@inheritDoc}
83 */
84 public String getBugName() {
85 return getClass().getName();
86 }
87 }