--- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java Tue Mar 06 17:43:21 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java Tue Mar 06 10:45:47 2018 -0800
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4749567 8071982 8175200 8186332 8185371
+ * @bug 4749567 8071982 8175200 8186332 8185371 8182765
* @summary Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree,
* -stylesheetfile, --main-stylesheet, --add-stylesheet options.
* @author Bhavesh Patel
@@ -198,7 +198,7 @@
checkOutput("src-html/linksource/AnnotationTypeField.html", true,
"<title>Source code</title>",
- "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">"
+ "<span class=\"sourceLineNo\">031</span><a id=\"line.31\">"
+ "@Documented public @interface AnnotationTypeField {</a>");
checkOutput("linksource/Properties.html", true,
@@ -211,7 +211,7 @@
checkOutput("src-html/linksource/Properties.html", true,
"<title>Source code</title>",
- "<span class=\"sourceLineNo\">031</span><a name=\"line.31\"> "
+ "<span class=\"sourceLineNo\">031</span><a id=\"line.31\"> "
+ "public Object someProperty() {</a>");
checkOutput("linksource/SomeClass.html", true,
@@ -226,13 +226,13 @@
checkOutput("src-html/linksource/SomeClass.html", true,
"<title>Source code</title>",
- "<span class=\"sourceLineNo\">029</span><a name=\"line.29\">"
+ "<span class=\"sourceLineNo\">029</span><a id=\"line.29\">"
+ "public class SomeClass {</a>",
- "<span class=\"sourceLineNo\">031</span><a name=\"line.31\"> "
+ "<span class=\"sourceLineNo\">031</span><a id=\"line.31\"> "
+ "public int field;</a>",
- "<span class=\"sourceLineNo\">033</span><a name=\"line.33\"> "
+ "<span class=\"sourceLineNo\">033</span><a id=\"line.33\"> "
+ "public SomeClass() {</a>",
- "<span class=\"sourceLineNo\">036</span><a name=\"line.36\"> "
+ "<span class=\"sourceLineNo\">036</span><a id=\"line.36\"> "
+ "public int method() {</a>");
checkOutput("linksource/SomeEnum.html", true,
@@ -244,6 +244,40 @@
+ "\"../src-html/linksource/SomeEnum.html#line.30\">VALUE2</a></pre>");
checkOutput("src-html/linksource/SomeEnum.html", true,
+ "<span class=\"sourceLineNo\">029</span><a id=\"line.29\"> VALUE1,</a>",
+ "<span class=\"sourceLineNo\">030</span><a id=\"line.30\"> VALUE2</a>");
+ }
+
+ @Test
+ void testLinkSource_html4() {
+ javadoc("-d", "out-9-html4",
+ "-html4",
+ "-linksource",
+ "-javafx",
+ "-sourcepath", testSrc,
+ "-package",
+ "linksource");
+ checkExit(Exit.OK);
+
+ checkOutput("src-html/linksource/AnnotationTypeField.html", true,
+ "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">"
+ + "@Documented public @interface AnnotationTypeField {</a>");
+
+ checkOutput("src-html/linksource/Properties.html", true,
+ "<span class=\"sourceLineNo\">031</span><a name=\"line.31\"> "
+ + "public Object someProperty() {</a>");
+
+ checkOutput("src-html/linksource/SomeClass.html", true,
+ "<span class=\"sourceLineNo\">029</span><a name=\"line.29\">"
+ + "public class SomeClass {</a>",
+ "<span class=\"sourceLineNo\">031</span><a name=\"line.31\"> "
+ + "public int field;</a>",
+ "<span class=\"sourceLineNo\">033</span><a name=\"line.33\"> "
+ + "public SomeClass() {</a>",
+ "<span class=\"sourceLineNo\">036</span><a name=\"line.36\"> "
+ + "public int method() {</a>");
+
+ checkOutput("src-html/linksource/SomeEnum.html", true,
"<span class=\"sourceLineNo\">029</span><a name=\"line.29\"> VALUE1,</a>",
"<span class=\"sourceLineNo\">030</span><a name=\"line.30\"> VALUE2</a>");
}