Java 如何自动生成新的单元测试ant报告

Java 如何自动生成新的单元测试ant报告,java,junit,ant,Java,Junit,Ant,我正在使用ant junit为我的单元测试生成报告,因此假设我有一个名为userServiceTest的单元测试,所以在my build.xml文件中,我放了以下内容: <target name="UserServiceTest"> <mkdir dir="${junit.output.dir}" /> <junit fork="yes" printsummary="withOutAndErr"> <

我正在使用ant junit为我的单元测试生成报告,因此假设我有一个名为
userServiceTest
的单元测试,所以在
my build.xml
文件中,我放了以下内容:

<target name="UserServiceTest">
        <mkdir dir="${junit.output.dir}" />
        <junit fork="yes" printsummary="withOutAndErr">
            <formatter type="xml" />
            <test name="webapp.service.UserServiceTest" todir="${junit.output.dir}" />
            <jvmarg line="-ea" />
            <classpath refid="Web Application.classpath" />
        </junit>
    </target>

现在让我们假设我已经添加了一个新的单元测试类,名为
productServiceTest
,是否可以在我的报告中自动生成这个新的单元测试

提前谢谢。

尝试
而不是


尝试
而不是


<target name="UserServiceTest">
        <mkdir dir="${junit.output.dir}" />
        <junit fork="yes" printsummary="withOutAndErr">
            <formatter type="xml" />
            <batchtest fork="yes" todir="${junit.output.dir}">
                 <fileset dir="${src.tests}">
                      <include name="webapp.service.*ServiceTest"/> 
                  </fileset>
            </batchtest>
            <jvmarg line="-ea" />
            <classpath refid="Web Application.classpath" />
        </junit>
</target>