【发布时间】:2014-04-12 02:43:55
【问题描述】:
我是 ant 和 stackoverflow 的新手 :-)
我在运行junit测试时遇到了这个问题,尝试了不同的方法来解决它,已经2天了,我什么也没得到:-(
我手动下载了 ant-junit jar,因为 ivy 说它无法为我进行检索:-(
我的 build.xml,只是相关部分:
<property name="FileTest" location="${user.home}/software_construction/hg/armidale_students/build/classes/armidale/api/io"/>
<property name="FileTestFiles" location="${user.home}/software_construction/hg/armidale_students/src/armidale/api/io"/>
<property name="JunitJarLocation" location="${user.home}/software_construction/hg/armidale_students/lib/junit-4.11.jar"/>
<property name="hamcrestLocation" location="${user.home}/software_construction/hg/armidale_students/lib/hamcrest-core-1.3.jar"/>
<property name="antjunitLocation" location="${user.home}/software_construction/hg/armidale_students/lib/ant-junit-1.9.3.jar"/>
<junit printsummary="yes" haltonfailure="yes">
<classpath refid="classpath.test" />
<batchtest todir="${JUnitTestOutput}">
<fileset dir="${FileTestFiles}">
<include name="*Test*.java" />
</fileset>
<formatter type="brief" usefile="false"/>
<formatter type="plain"/>
</batchtest>
</junit>
so .java 文件在 src 文件夹中,而 .class 文件在 lib 文件夹中 预先感谢任何回答的人!
更新:
<path id="classpath.test">
<pathelement location="${user.home}/software_construction/hg/armidale_students/lib/ant- junit-1.9.3.jar"/>
<pathelement location="${user.home}/software_construction/hg/armidale_students/lib/junit-4.11.jar}"/>
<pathelement path="${FileTest}" />
</path>
不知道为什么需要四个空格来生成代码.....反正路径代码如上
【问题讨论】:
-
拥有所有 build.xml 和错误堆栈跟踪会很棒。否则它更像是一种猜测。