JUnitDoc

Here is a very small documentation about how to use the junitdoc doclet.

Usage

do the following steps:

  1. create the XML reports of your tests by using the ANT task junit, running batchtest to produce a XML file for each of your test case. For example use the following ANT task:
    <junit>
      <classpath>
        <pathelement location="path.to.your.test.classes"/>
      </classpath>
      <formatter type="xml"/>
      <batchtest todir="your.output.directory">
        <fileset dir="path.to.your.test.classes">
          <include name="**/*Test*.java"/>
          <exclude name="**/AllTests.java"/>
        </fileset>
      </batchtest>
    </junit>
      
    
  2. run the ANT task javadoc to generate the HTML report of your tests. You can use a ANT task as follows:
    <javadoc docletpath="path.to.junitdoc.jar"
        doclet="junitdoc.Doclet"
        destdir="path.to.your.html.output.dir"
        packagenames="your.packages.*"
        sourcepath="path.to.your.sources"
        additionalparam="-report your.output.directory"/>
      
    
    Where your.output.directory is the same as in step one.
  3. watch the generated HTML reports by opening path.to.your.html.output.dir/index.html

Enjoy the example html report pages that are created from the test cases of the junit sources. Note that not all tests run on my mashine (don't know why, but that gives a good example). Unfortunally the javadoc of the junit test cases are poor, so you don't see much of the mergerd javadoc in the test report. But still you can find some :-)

SourceForge.net Logo