test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java
changeset 49139 771616d26ca1
parent 48028 9e022f580a9d
child 50293 edfb87b2520e
equal deleted inserted replaced
49138:67912cbf784a 49139:771616d26ca1
     1 /*
     1 /*
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 /*
    26 /*
    27  * @test
    27  * @test
    28  * @bug      8173425 8186332
    28  * @bug      8173425 8186332 8182765
    29  * @summary  tests for the summary tag behavior
    29  * @summary  tests for the summary tag behavior
    30  * @library  ../lib
    30  * @library  ../lib
    31  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    31  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    32  * @build    JavadocTester
    32  * @build    JavadocTester
    33  * @run main TestSummaryTag
    33  * @run main TestSummaryTag
    41     }
    41     }
    42 
    42 
    43     @Test
    43     @Test
    44     void test1() {
    44     void test1() {
    45         javadoc("-d", "out1",
    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              + "<h4>m3</h4>\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     void test1_html4() {
       
   101         javadoc("-d", "out1-html4",
       
   102                 "-html4",
    46                 "-sourcepath", testSrc,
   103                 "-sourcepath", testSrc,
    47                 "p1");
   104                 "p1");
    48         checkExit(Exit.OK);
   105         checkExit(Exit.OK);
    49 
   106 
    50         checkOutput("index-all.html", true,
   107         checkOutput("index-all.html", true,
    77             + "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m4--\">m4()"
   134             + "<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"
   135             + "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n"
    79             + "<dd>\n"
   136             + "<dd>\n"
    80             + "<div class=\"block\">First sentence i.e. the first sentence</div>\n"
   137             + "<div class=\"block\">First sentence i.e. the first sentence</div>\n"
    81             + "</dd>\n"
   138             + "</dd>\n"
    82             + "</dl>\n",
   139             + "</dl>\n"
    83             "<div class=\"block\">The first... line</div>\n"
       
    84         );
   140         );
       
   141     }
    85 
   142 
    86         // make sure the second @summary's content is displayed correctly
       
    87         checkOutput("p1/A.html", true,
       
    88              "<li class=\"blockList\">\n"
       
    89              + "<h4>m3</h4>\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     @Test
   143     @Test
    99     void test2() {
   144     void test2() {
   100         javadoc("-d", "out2",
   145         javadoc("-d", "out2",
   101                 "-sourcepath", testSrc,
   146                 "-sourcepath", testSrc,
   102                 "p2");
   147                 "p2");