Annotation Interface Doctests


@Documented @Retention(RUNTIME) @Target(TYPE) public @interface Doctests
Indicates that the javadoc of the annotated class contains doctests which should be run as JUnit tests. When JDoctest is on the test classpath, the JUnit Platform finds its test engine, which runs javadoc on the source file of each annotated class it is asked to test.

This annotation has no runtime dependencies; classes using it do not need JUnit on their classpath. It is also published on its own, as the net.cscott:jdoctest-annotations Maven artifact, so that production code which uses it needn't depend on JDoctest (and its JavaScript engine) outside of its tests.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The directory containing the source file of the annotated class.
  • Element Details

    • srcRoot

      String srcRoot
      The directory containing the source file of the annotated class. If empty (the default), the net.cscott.jdoctest.srcRoot JUnit configuration parameter is used, or else "src".
      Default:
      ""