不能处理ANT给出DomSource的测试用例



我有一个运行testNG testCase的ant任务。但是在运行时,它显示的错误如下1

 [testng] Error 
 [testng]   DOMSource cannot be processed: check that saxon8-dom.jar is on the classpath
 [testng] [GeneralXMLOutput] [Error] DOMSource cannot be processed: check that saxon8- dom.jar is on the classpath

我的lib文件夹有jdom-0.7.jar, saxon-8.7.jar, saxonconnection .jar这是与xml相关的。是jar文件依赖冲突吗?

如何解决这个错误?

ANT任务

 <target name="runTests" depends="compile">
    <testng classpath="${test.classpath}:${build.dir}">
        <xmlfileset dir="${basedir}" includes="testng.xml" />
    </testng>
</target>

我在其他一些类中使用了来自rt.jar的javax.xml.transform.Transformer api, saxon也有Transformer api。(这是否会产生问题?)

认为,

消息非常清楚:检查saxon8-dom是否在类路径上。从你所说的来看,它不是。

但是Saxon 8.7是一个老版本,当前的版本是9.4。最近的版本包括在主JAR文件中对DOM的支持——过去它被分开的原因是DOM API在JDK 1.4和JDK 1.5之间以不兼容的方式改变,当Saxon放弃对JDK 1.4的支持时,这个问题就消失了。

相关内容

最新更新