DOCLET: JUnit report include JavaDoc : Ojido-kun UT5

I created the JUnitReport for ant task.

But those file are not include JavaDoc ;-)

So I create JUnit report include JavaDoc using JavaDoclet technology (Sample1,Sample2(Solution)).

How to use

1st step: create the java source code.

    /**
     * Hello world test message
     */
    @Test
    public void testHello() {
        assertTrue(true);
    }

Next step: write build.xml the following text. (For JUnit)

  <path id="common.classpath">
    <pathelement path="C:\eclipse\plugins\org.hamcrest.core_1.3.0.v201303031735.jar" />
    <pathelement path="C:\eclipse\plugins\org.junit_4.12.0.v201504281640/junit.jar" />
    <pathelement path="C:\Program Files\Java\jdk1.8.0_77\lib\tools.jar" />
    <pathelement location="./classes" />
  </path>
  <target name="all">
    <mkdir dir="./target/" />
    <delete dir="./target/junit" />
    <mkdir dir="./target/junit" />
    <junit printsummary="yes" haltonfailure="no">
      <classpath refid="common.classpath" />
      <formatter type="xml" />
      <batchtest fork="yes" todir="./target/junit">
        <fileset dir="./src/test/java">
          <include name="**/*Test.java" />
        </fileset>
      </batchtest>
    </junit>

Last step: write build.xml the following text. (For output report)

    <delete dir="./target/ut5" />
    <mkdir dir="./target/ut5" />
    <javadoc destdir="./target/ut5"
      encoding="UTF-8" docencoding="UTF-8"
      additionalparam="-J-Dfile.encoding=UTF-8">
      <classpath refid="common.classpath" />
      <packageset dir="src/test/java">
          <include name="jp/**" />
      </packageset>
      <doclet name="jp.ruru.park.ando.ut5.UT5Doclet" path="lib/UT5DocLet.jar">
        <param name="-junit" value="./target/junit" />
      </doclet>
    </javadoc>

junittree option

Or this. (For Column change)

    <delete dir="./target/ut5" />
    <mkdir dir="./target/ut5" />
    <javadoc destdir="./target/ut5"
      encoding="UTF-8" docencoding="UTF-8"
      additionalparam="-J-Dfile.encoding=UTF-8"
      charset="UTF-8">
      <classpath refid="common.classpath" />
      <packageset dir="src/test/java">
          <include name="jp/**" />
      </packageset>
      <doclet name="jp.ruru.park.ando.ut5.UT5Doclet" path="lib/UT5DocLet.jar">
        <param name="-junit" value="./target/junit" />
        <param name="-junittree" value="abdegh cf r i j tt s nqq l" />
      </doclet>
    </javadoc>

-junittree option value have the following meaning.

Key Mean
a Package No
b Package Name
c Package Message
d Class No
e Class Name
f Class Message
g Test Case No
h Test Case Name
i Test Case Message
j Status
k TimeStamp
l Time
m Author
n Version
o Blank (Package)
p Blank (Class)
q Blank (Test Case)
r Precondition
s Author name
t Date
u Old TimeStamp
v Old Date
w Pass the test code.
[space] Ignore