langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java
changeset 41252 058d83c9b1c7
parent 36709 f9f252088afa
child 41451 a847c7aa25a7
equal deleted inserted replaced
41251:6112540cd0c1 41252:058d83c9b1c7
    30  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    30  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    31  * @build    JavadocTester TestHelpOption
    31  * @build    JavadocTester TestHelpOption
    32  * @run main TestHelpOption
    32  * @run main TestHelpOption
    33  */
    33  */
    34 
    34 
       
    35 import java.util.*;
       
    36 import java.util.stream.*;
       
    37 
    35 public class TestHelpOption extends JavadocTester {
    38 public class TestHelpOption extends JavadocTester {
    36 
    39 
    37     public static void main(String... args) throws Exception {
    40     public static void main(String... args) throws Exception {
    38         TestHelpOption tester = new TestHelpOption();
    41         TestHelpOption tester = new TestHelpOption();
    39         tester.runTests();
    42         tester.runTests();
       
    43     }
       
    44 
       
    45     @Test
       
    46     void testLineLengths() {
       
    47         javadoc("-d", "out1",
       
    48                 "-sourcepath", testSrc,
       
    49                 "-X",
       
    50                 testSrc("TestXOption.java"));
       
    51         checkExit(Exit.OK);
       
    52         List<String> longLines = getOutputLines(Output.OUT).stream()
       
    53                 .filter(s -> s.length() > 80)
       
    54                 .collect(Collectors.toList());
       
    55         checking("line lengths");
       
    56         if (longLines.isEmpty()) {
       
    57             passed("all lines OK");
       
    58         } else {
       
    59             out.println("long lines:");
       
    60             longLines.stream().forEach(s -> out.println(">>>" + s + "<<<"));
       
    61             failed(longLines.size() + " long lines");
       
    62         }
    40     }
    63     }
    41 
    64 
    42     @Test
    65     @Test
    43     void testWithOption() {
    66     void testWithOption() {
    44         javadoc("-d", "out1",
    67         javadoc("-d", "out1",
   105         checkOutput(Output.OUT, withOption,
   128         checkOutput(Output.OUT, withOption,
   106                 "-d ",
   129                 "-d ",
   107                 "-use ",
   130                 "-use ",
   108                 "-version ",
   131                 "-version ",
   109                 "-author ",
   132                 "-author ",
   110                 "-docfilessubdirs ",
   133                 "-docfilessubdirs\n",
   111                 "-splitindex ",
   134                 "-splitindex ",
   112                 "-windowtitle ",
   135                 "-windowtitle ",
   113                 "-doctitle ",
   136                 "-doctitle ",
   114                 "-header ",
   137                 "-header ",
   115                 "-footer ",
   138                 "-footer ",
   117                 "-link ",
   140                 "-link ",
   118                 "-linkoffline ",
   141                 "-linkoffline ",
   119                 "-excludedocfilessubdir ",
   142                 "-excludedocfilessubdir ",
   120                 "-group ",
   143                 "-group ",
   121                 "-nocomment ",
   144                 "-nocomment ",
   122                 "-nodeprecated ",
   145                 "-nodeprecated\n",
   123                 "-noqualifier ",
   146                 "-noqualifier ",
   124                 "-nosince ",
   147                 "-nosince ",
   125                 "-notimestamp ",
   148                 "-notimestamp ",
   126                 "-nodeprecatedlist ",
   149                 "-nodeprecatedlist\n",
   127                 "-notree ",
   150                 "-notree ",
   128                 "-noindex ",
   151                 "-noindex ",
   129                 "-nohelp ",
   152                 "-nohelp ",
   130                 "-nonavbar ",
   153                 "-nonavbar ",
   131                 "-serialwarn ",
   154                 "-serialwarn ",