< prev index next >

test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java

Print this page




  32  */
  33 
  34 import javadoc.tester.JavadocTester;
  35 
  36 public class TestSummaryTag extends JavadocTester {
  37 
  38     public static void main(String... args) throws Exception {
  39         TestSummaryTag tester = new TestSummaryTag();
  40         tester.runTests();
  41     }
  42 
  43     @Test
  44     public void test1() {
  45         javadoc("-d", "out1",
  46                 "-sourcepath", testSrc,
  47                 "p1");
  48         checkExit(Exit.OK);
  49 
  50         checkOutput("index-all.html", true,
  51             "<dl>\n"
  52             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m()\">m()"
  53             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  54             + "<dd>\n"
  55             + "<div class=\"block\">First sentence</div>\n"
  56             + "</dd>\n"
  57             + "<dt><span class=\"memberNameLink\"><a href=\"p1/B.html#m()\">m()"
  58             + "</a></span> - Method in class p1.<a href=\"p1/B.html\" title=\"class in p1\">B</a></dt>\n"
  59             + "<dd>\n"
  60             + "<div class=\"block\">First sentence</div>\n"
  61             + "</dd>\n"
  62             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m1()\">m1()"
  63             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  64             + "<dd>\n"
  65             + "<div class=\"block\"> First sentence </div>\n"
  66             + "</dd>\n"
  67             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m2()\">m2()"
  68             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  69             + "<dd>\n"
  70             + "<div class=\"block\">Some html &lt;foo&gt; &nbsp; codes</div>\n"
  71             + "</dd>\n"
  72             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m3()\">m3()"
  73             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  74             + "<dd>\n"
  75             + "<div class=\"block\">First sentence </div>\n"
  76             + "</dd>\n"
  77             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m4()\">m4()"
  78             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  79             + "<dd>\n"
  80             + "<div class=\"block\">First sentence i.e. the first sentence</div>\n"
  81             + "</dd>\n"
  82             + "</dl>\n",
  83             "<div class=\"block\">The first... line</div>\n"
  84         );
  85 
  86         // make sure the second @summary's content is displayed correctly
  87         checkOutput("p1/A.html", true,
  88              "<li class=\"blockList\">\n"
  89              + "<h3>m3</h3>\n"
  90              + "<pre class=\"methodSignature\">public&nbsp;void&nbsp;m3()</pre>\n"
  91              + "<div class=\"block\">First sentence  some text maybe second sentence.</div>\n"
  92              + "</li>\n"
  93         );
  94 
  95         checkOutput("p1/package-summary.html", true,
  96                 "<div class=\"block\">The first... line second from ...</div>");
  97     }
  98 
  99     @Test
 100     public void test2() {
 101         javadoc("-d", "out2",
 102                 "-sourcepath", testSrc,
 103                 "p2");
 104         checkExit(Exit.OK);
 105 
 106         checkOutput(Output.OUT, true, "package.html:3: warning: invalid use of @summary");
 107 
 108         checkOutput("index-all.html", true, "<div class=\"block\">foo bar</div>\n");
 109 
 110         checkOutput("p2/package-summary.html", true, "<div class=\"block\">foo bar baz.</div>\n");


  32  */
  33 
  34 import javadoc.tester.JavadocTester;
  35 
  36 public class TestSummaryTag extends JavadocTester {
  37 
  38     public static void main(String... args) throws Exception {
  39         TestSummaryTag tester = new TestSummaryTag();
  40         tester.runTests();
  41     }
  42 
  43     @Test
  44     public void test1() {
  45         javadoc("-d", "out1",
  46                 "-sourcepath", testSrc,
  47                 "p1");
  48         checkExit(Exit.OK);
  49 
  50         checkOutput("index-all.html", true,
  51             "<dl>\n"
  52             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m()\">m()"
  53             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  54             + "<dd>\n"
  55             + "<div class=\"block\">First sentence</div>\n"
  56             + "</dd>\n"
  57             + "<dt><span class=\"memberNameLink\"><a href=\"p1/B.html#m()\">m()"
  58             + "</a></span> - Method in class p1.<a href=\"p1/B.html\" title=\"class in p1\">B</a></dt>\n"
  59             + "<dd>\n"
  60             + "<div class=\"block\">First sentence</div>\n"
  61             + "</dd>\n"
  62             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m1()\">m1()"
  63             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  64             + "<dd>\n"
  65             + "<div class=\"block\"> First sentence </div>\n"
  66             + "</dd>\n"
  67             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m2()\">m2()"
  68             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  69             + "<dd>\n"
  70             + "<div class=\"block\">Some html &lt;foo&gt; &nbsp; codes</div>\n"
  71             + "</dd>\n"
  72             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m3()\">m3()"
  73             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  74             + "<dd>\n"
  75             + "<div class=\"block\">First sentence </div>\n"
  76             + "</dd>\n"
  77             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m4()\">m4()"
  78             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
  79             + "<dd>\n"
  80             + "<div class=\"block\">First sentence i.e. the first sentence</div>\n"
  81             + "</dd>\n"
  82             + "</dl>\n",
  83             "<div class=\"block\">The first... line</div>\n"
  84         );
  85 
  86         // make sure the second @summary's content is displayed correctly
  87         checkOutput("p1/A.html", true,
  88              "<li class=\"blockList\">\n"
  89              + "<h3>m3</h3>\n"
  90              + "<pre>public&nbsp;void&nbsp;m3()</pre>\n"
  91              + "<div class=\"block\">First sentence  some text maybe second sentence.</div>\n"
  92              + "</li>\n"
  93         );
  94 
  95         checkOutput("p1/package-summary.html", true,
  96                 "<div class=\"block\">The first... line second from ...</div>");
  97     }
  98 
  99     @Test
 100     public void test2() {
 101         javadoc("-d", "out2",
 102                 "-sourcepath", testSrc,
 103                 "p2");
 104         checkExit(Exit.OK);
 105 
 106         checkOutput(Output.OUT, true, "package.html:3: warning: invalid use of @summary");
 107 
 108         checkOutput("index-all.html", true, "<div class=\"block\">foo bar</div>\n");
 109 
 110         checkOutput("p2/package-summary.html", true, "<div class=\"block\">foo bar baz.</div>\n");
< prev index next >