0
我是新來的螞蟻,和計算器以及:-)螞蟻JUnit測試錯誤:NoClassDefFoundError的
運行JUnit測試時,我得到了這個問題,嘗試不同的方法來解決這個問題,它已經2天,我得到了什麼:-(
我mannuly下載螞蟻junit的罐子,因爲常春藤說,它無法做檢索我:-(
我的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>
所以.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和錯誤堆棧跟蹤。否則,這更像是一種猜測。 – olyv