<?xml version="1.0" encoding="UTF-8"?>
<project name= "httpclientch0401" basedir= ".">
<property name= "lib.dir" value= "lib" />
<path id= "test.classpath" >
<!-- adding the saxon jar to your classpath -->
<fileset dir= "${lib.dir}" includes= "*.jar" />
</path>
<target name= "httpclientch0401" >
<xslt in= "E:\Third_Grade_Up\work_entity\api_workspace\httpclientch0401\test-output\testng-results.xml"
style= "E:\Third_Grade_Up\work_entity\api_workspace\httpclientch0401\test-output\testng-results.xsl"
out= "E:\Third_Grade_Up\work_entity\api_workspace\httpclientch0401\test-output\index.html" >
<!-- you need to specify the directory here again -->
<param name= "testNgXslt.outputDir" expression= "E:\Third_Grade_Up\work_entity\api_workspace\httpclientch0401\test-output" />
<classpath refid= "test.classpath" />
</xslt>
</target>
</project>
【注】
1.build.xml 文件必须在test-output下面,否则找不到
2.lib文件不是项目的lib文件,而是test-output下新建的lib文件,方便buid.xml文件查找,(应该和参数关系,用默认参数就要都放在test-output下面),build.xml使用ant运行时,会引用到lib下的jar包
3.运行:1)先将想要生成测试报告的类运行一遍,再将build.xml 运行一遍。就会生成刚刚那个类的报告