On Mon, 8 Nov 2021 22:40:07 GMT, Jonathan Gibbons <j...@openjdk.org> wrote:
>> Please review a moderately simple improvement for `JavadocTester` and a >> related new test. >> >> A new `OutputChecker` class is introduced that mostly supersedes the >> existing methods to check the output generated by javadoc and the standard >> doclet. A self-imposed restriction is that no existing tests are modified. >> >> The new class can be used to check files generated by the doclet and the >> streams written by the tool. It can be configured to check for ordered >> output or not, overlapping output, and complete coverage, and can search for >> literal strings and regular expressions. >> >> There is a corresponding new test which is a non-standard use of >> `JavadocTester`, since it is designed to test `JavadocTester` itself, and >> not javadoc or the doclet. (Quis custodiet ipsos custodes?) Various >> methods are overridden so that the operation of the underlying methods can >> be checked. >> >> Although it is a goal to NOT modify the code of any existing tests, it turns >> out to be reasonable to adapt some of the existing `check...` methods to use >> the new `OutputChecker`. All javadoc tests pass, both locally and on all >> standard platforms. Many/most uses of the existing `checkOutput` method >> provide "ordered" strings, and are candidates to use the new ordered check. >> But enough uses are _not_ ordered, so it is not reasonable to change the >> default at this time. It is noted as a TODO to examine the appropriate test >> cases, so that we can decide whether to fix those tests and change the >> default. > > Jonathan Gibbons has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains six commits: > > - Merge remote-tracking branch 'upstream/master' into > 8273154.JavadocTester-checker > - Address review comments > - Add, `checkAnyOf`, update `checkUnique`, reformat some comments > - Merge remote-tracking branch 'upstream/master' into > 8273154.JavadocTester-checker > - Merge with upstream/master > - JDK-8273154: Provide a JavadocTester method for non-overlapping, unordered > output matching test/langtools/jdk/javadoc/testJavadocTester/TestJavadocTester.java line 332: > 330: public void testComplete_Ordered() { > 331: messages.clear(); > 332: // In this following calls, the strings are specified in the > expected order. Should it be "these" or "the"? test/langtools/jdk/javadoc/testJavadocTester/TestJavadocTester.java line 353: > 351: public void testComplete_Unordered() { > 352: messages.clear(); > 353: // In this following calls, the strings are deliberately > specified out of the expected order. Similarly: should it be "these" or "the"? test/langtools/jdk/javadoc/testJavadocTester/TestJavadocTester.java line 437: > 435: .toArray(String[]::new); > 436: } > 437: } Add newline. ------------- PR: https://git.openjdk.java.net/jdk/pull/5743