TestTagInheritence.java revision 3294:9adfb22ff08f
1/*
2 * Copyright (c) 2002, 2016, 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 */
23
24/*
25 * @test
26 * @bug     4496223 4496270 4618686 4720974 4812240 6253614 6253604
27 * @summary <DESC>
28 * @author  jamieh
29 * @library ../lib
30 * @modules jdk.javadoc/jdk.javadoc.internal.tool
31 * @build JavadocTester
32 * @run main TestTagInheritence
33 */
34
35// TODO: Inheritence should be Inheritance!   fix separately as noreg-trivial
36public class TestTagInheritence extends JavadocTester {
37
38    public static void main(String... args) throws Exception {
39        TestTagInheritence tester = new TestTagInheritence();
40        tester.runTests();
41    }
42
43    @Test
44    void test() {
45        javadoc("-Xdoclint:none",
46                "-d", "out",
47                "-sourcepath", testSrc,
48                "pkg", "firstSentence", "firstSentence2");
49        checkExit(Exit.OK);
50
51        //Test bad inheritDoc tag warning.
52        checkOutput(Output.OUT, true,
53                "warning - @inheritDoc used but testBadInheritDocTag() "
54                + "does not override or implement any method.");
55
56        //Test valid usage of inheritDoc tag.
57        for (int i = 1; i < 40; i++) {
58            checkOutput("pkg/TestTagInheritence.html", true,
59                    "Test " + i + " passes");
60        }
61
62        //First sentence test (6253614)
63        checkOutput("firstSentence/B.html", true,
64                "<div class=\"block\">First sentence.</div>");
65
66        //Another first sentence test (6253604)
67        checkOutput("firstSentence2/C.html", true,
68                "<div class=\"block\">First sentence.</div>");
69    }
70}
71