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", |