26 * @bug 4951228 6290760 8025633 8026567 |
26 * @bug 4951228 6290760 8025633 8026567 |
27 * @summary Test the case where the overriden method returns a different |
27 * @summary Test the case where the overriden method returns a different |
28 * type than the method in the child class. Make sure the |
28 * type than the method in the child class. Make sure the |
29 * documentation is inherited but the return type isn't. |
29 * documentation is inherited but the return type isn't. |
30 * @author jamieh |
30 * @author jamieh |
31 * @library ../lib/ |
31 * @library ../lib |
32 * @build JavadocTester |
32 * @build JavadocTester |
33 * @build TestMemberSummary |
|
34 * @run main TestMemberSummary |
33 * @run main TestMemberSummary |
35 */ |
34 */ |
36 |
35 |
37 public class TestMemberSummary extends JavadocTester { |
36 public class TestMemberSummary extends JavadocTester { |
38 |
37 |
39 //Javadoc arguments. |
38 public static void main(String... args) throws Exception { |
40 private static final String[] ARGS = new String[] { |
39 TestMemberSummary tester = new TestMemberSummary(); |
41 "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg","pkg2" |
40 tester.runTests(); |
42 }; |
41 } |
43 |
42 |
44 //Input for string search tests. |
43 @Test |
45 private static final String[][] TEST = { |
44 void test() { |
46 // Check return type in member summary. |
45 javadoc("-d", "out", |
47 { "pkg/PublicChild.html", |
46 "-sourcepath", testSrc, |
48 "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n" + |
47 "pkg","pkg2"); |
49 "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" + |
48 checkExit(Exit.OK); |
50 "returnTypeTest</a></span>()</code>" |
|
51 }, |
|
52 // Check return type in member detail. |
|
53 { "pkg/PublicChild.html", |
|
54 "<pre>public <a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" + |
|
55 "PublicChild</a> returnTypeTest()</pre>" |
|
56 }, |
|
57 |
49 |
58 // Legacy anchor dimensions (6290760) |
50 checkOutput("pkg/PublicChild.html", true, |
59 { "pkg2/A.html", |
51 // Check return type in member summary. |
60 "<a name=\"f-java.lang.Object:A-\">\n" + |
52 "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n" |
61 "<!-- -->\n" + |
53 + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" |
62 "</a><a name=\"f-T:A-\">\n" + |
54 + "returnTypeTest</a></span>()</code>", |
63 "<!-- -->\n" + |
55 // Check return type in member detail. |
64 "</a>" |
56 "<pre>public <a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" |
65 }, |
57 + "PublicChild</a> returnTypeTest()</pre>"); |
66 }; |
|
67 |
58 |
68 /** |
59 // Legacy anchor dimensions (6290760) |
69 * The entry point of the test. |
60 checkOutput("pkg2/A.html", true, |
70 * @param args the array of command line arguments. |
61 "<a name=\"f-java.lang.Object:A-\">\n" |
71 */ |
62 + "<!-- -->\n" |
72 public static void main(String[] args) { |
63 + "</a><a name=\"f-T:A-\">\n" |
73 TestMemberSummary tester = new TestMemberSummary(); |
64 + "<!-- -->\n" |
74 tester.run(ARGS, TEST, NO_TEST); |
65 + "</a>"); |
75 tester.printSummary(); |
|
76 } |
66 } |
77 } |
67 } |