Menu

#25 Provide a JUnit style Ant task

open
nobody
None
5
2004-04-07
2004-04-07
Curt Cox
No

Going from an Ant script with a JUnit tests to one with
NoUnit reports should be as painless as possible. I
propose distributing a modified JUnit Ant task with
support for NoUnit added through formatters. To
illustrate, I provide a sample JUnit Ant task and the
same task modifed for NoUnit.

before:
<junit fork="yes" failureproperty="test.failure"
timeout="600000">
<classpath refid="classpath"/>
<formatter type="brief" usefile="false"/>
<formatter type="plain" usefile="true"/>
<formatter type="xml" usefile="true"/>
<batchtest todir="${unit.results}">
<fileset dir="${unit.src}">
<include name="**/*Test.java"/>
<exclude name="**/PackageTest.java"/>
</fileset>
</batchtest>
</junit>

after:
<nounit fork="yes" failureproperty="test.failure"
timeout="600000">
<classpath refid="classpath"/>
<formatter type="brief" usefile="false"/>
<formatter type="plain" usefile="true"/>
<formatter type="xml" usefile="true"/>
<formatter type="call" usefile="true"/>
<batchtest todir="${unit.results}">
<fileset dir="${unit.src}">
<include name="**/*Test.java"/>
<exclude name="**/PackageTest.java"/>
</fileset>
</batchtest>
</nounit>

Thanks,
Curt

Discussion


Log in to post a comment.