2014-04-07 92 views
0

我目前正在嘗試使用ant xml文件來配置構建文件以運行junit測試。但是遇到了ClassNotFound異常。以下是應運行JUnit測試代碼的一部分:從build.xml運行jUnit測試時出現ClassNotFound異常

<target name="junitreport" > 
    <junit printsummary="yes" haltonfailure="no"> 
     <classpath refid="JUnit 4.libraryclasspath"/>  
     <formatter type="plain"/> 
     <formatter type="xml"/> 
     <batchtest todir="${junit.output.dir}"> 
     <fileset dir="src/tests"> 
      <include name="CalculatorTest.java"/> 
     </fileset> 
    </batchtest> 
    </junit> 
</target> 

這可怎麼解決呢?

+0

你確定類路徑的工作?你可以嘗試像這樣調試:' $ {testclasspath}' – CAustin

回答

相關問題