我用ant跑build。xml时,出现如下错误:
[junit] Test TestDie FAILED
[junitreport] Processing E:\eclipse workspace\Homework1\TESTS-TestSuites.xml to C:\Users\ADMINI~1\AppData\Local\Temp\null1952090219
[junitreport] Loading stylesheet jar:file:/D:/eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] : Error! 非 static Java 函数“replace”的第一个自变量不是有效的对象参考。
[junitreport] : Error! 无法将数据类型“void”转换成“reference”。
[junitreport] : Fatal Error! 无法编译样式表
[junitreport] Failed to process E:\eclipse workspace\Homework1\TESTS-TestSuites.xml
BUILD FAILED
这是出错处的代码:
<junit fork="yes" dir="${basedir}" haltonerror="no" failureProperty="test.failed">
<!--
Note the classpath order: instrumented classes are before the
original (uninstrumented) classes. This is important.
-->
<classpath location="${instrumented.dir}" />
<classpath location="${classes.dir}" />
<classpath location="${test.classes.dir}" />
<!--
The instrumented classes reference classes used by the
Cobertura runtime, so Cobertura and its dependencies
must be on your classpath.
-->
<classpath refid="cobertura.classpath" />