One solution might be the following. (I have a project that does this.)
You have a separate goal, similar to test with fileset , which restricts validation to only one class. Then pass the name of this class with -D at the ant command line:
ant -Dtest.module=MyClassUnderTest single_test
In the build.xml file (greatly reduced):
<target name="single_test" depends="compile" description="Run one unit test"> <junit> <batchtest> <fileset dir="${test.dir}" includes="**/${test.module}.class" /> </batchtest> </junit> </target>
martin clayton Dec 16 '09 at 0:49 2009-12-16 00:49
source share