我是 Ant 的初学者,但在尝试使用 JUnit 时遇到问题:
<target name="test" depends="compile" description="JUnit Tests">
<junit printsummary="yes" failureproperty="junit.failure" fork="yes">
<classpath refid="junit.classpath"/>
<classpath path="${myAntTestBin.dir}"/>
<formatter type="plain" usefile="false"/>
<test name="fr.isima.myAntTest.ProjectTest"/>
</junit>
</target>
但是现在,我有这些错误:
test:
[junit] Running fr.isima.myAntTest.ProjectTest
[junit] Testsuite: fr.isima.myAntTest.ProjectTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit]
[junit] Caused an ERROR
[junit] fr.isima.myAntTest.ProjectTest
[junit] java.lang.ClassNotFoundException: fr.isima.myAntTest.ProjectTest
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
[junit] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Class.java:186)
[junit]
[junit] Test fr.isima.myAntTest.ProjectTest FAILED
问题是什么 ?先感谢您 !