Ant 如何在build.xml中运行Junit文件
我需要从ant build.xml运行一个junit文件,其中junit驻留在testscripts包中,junit类已被另一个名为supportlibraries的包中的其他类扩展, 现在来看看如何通过build.xml运行junit 有人能帮我吗Ant 如何在build.xml中运行Junit文件,ant,junit,junit4,build.xml,Ant,Junit,Junit4,Build.xml,我需要从ant build.xml运行一个junit文件,其中junit驻留在testscripts包中,junit类已被另一个名为supportlibraries的包中的其他类扩展, 现在来看看如何通过build.xml运行junit 有人能帮我吗 谢谢除了Mark O'Connor的建议之外,您还需要在junit任务中设置依赖项 <junit ....> <classpath> <pathelement path="testscripts" /&
谢谢除了Mark O'Connor的建议之外,您还需要在junit任务中设置依赖项
<junit ....>
<classpath>
<pathelement path="testscripts" />
<pathelement path="supportlibraries">
<!-- Add other dependencies here. -->
</classpath>
<test name ="...">
</test>
</junit>
从Junit上的ANT doco开始: