Ant目标生成空的套件xml文件
我在我的项目中使用ant,我一直在尝试使用ant目标生成JUnit报告。我遇到的问题是,在执行结束时,我的TESTS-TestSuites.xml是空的。但是所有其他单独的测试xml文件都有数据。因此,我的html报告是空的,从某种意义上说,结果显示为“0” 这是我的蚂蚁目标Ant目标生成空的套件xml文件,ant,junit,Ant,Junit,我在我的项目中使用ant,我一直在尝试使用ant目标生成JUnit报告。我遇到的问题是,在执行结束时,我的TESTS-TestSuites.xml是空的。但是所有其他单独的测试xml文件都有数据。因此,我的html报告是空的,从某种意义上说,结果显示为“0” 这是我的蚂蚁目标 <!-- JUnit Reporting --> <target name="test-report" depends="build-all" description="Generate Test
<!-- JUnit Reporting -->
<target name="test-report" depends="build-all" description="Generate Test Results as HTML">
<taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator"/>
<junit printsummary="on" haltonfailure="off" haltonerror="off" fork="yes">
<batchtest fork="yes" todir="${test.reports}" filtertrace="on">
<fileset dir="${build.classes}" includes="**/Test*Selenium.class"/>
</batchtest>
<formatter type="plain" usefile="false"/>
<formatter type="xml" usefile="true"/>
<classpath>
<path refid="classpath"/>
<path refid="application"/>
</classpath>
</junit>
<echo message="running JUnit Report" />
<junitreport todir="${test.reports}">
<fileset dir="${test.reports}">
<include name="Test-*.xml" />
</fileset>
<report format="frames" todir="${test.reports.html}" />
</junitreport>
</target>
以下是junit报告的外观
提前感谢,我认为它的问题与案件有关。您已经说过Test-.xml。我认为应该是TEST-.xml 这就是为什么它不能聚合结果。有关更多信息,请将ant选项设置为-v。你可以看到所有的文件报告目标拿起
[junitreport] Processing C:\YukonSelenium\reports\TESTS-TestSuites.xml to C:\DOCUME~1\user\LOCALS~1\Temp\null1848051184
[junitreport] Loading stylesheet jar:file:/C:/DevApps/apache-ant-1.7.1/lib/ant
junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 859ms
[junitreport] Deleting: C:\DOCUME~1\user\LOCALS~1\Temp\null1848051184