我只是想运行我的 junit 测试类,它只有 jar 文件中的 syso,但总是得到以下错误:
[junit] Running testcases.TestCalculator
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Test testcases.TestCalculator FAILED
请帮我找出为什么它总是显示错误。请找到构建 xml。
<target name="jar" depends="compile">
<jar destfile="test.jar" basedir="build">
</jar>
</target>
<target name="run" depends="jar">
<mkdir dir="reports"/>
<junit printsummary="withOutAndErr" fork="true" includeantruntime="true" showoutput="true" >
<batchtest fork="yes" todir="reports">
<resources>
<zipfileset src="test.jar" includes="**/*Test*.class" />
</resources>
</batchtest>
<classpath refid="lib.jar" />
<formatter type="xml"/>
</junit>
</target>
<path id="lib.jar">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>