Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant 如何在build.xml中运行Junit文件_Ant_Junit_Junit4_Build.xml - Fatal编程技术网

Ant 如何在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" /&

我需要从ant build.xml运行一个junit文件,其中junit驻留在testscripts包中,junit类已被另一个名为supportlibraries的包中的其他类扩展, 现在来看看如何通过build.xml运行junit

有人能帮我吗
谢谢

除了Mark O'Connor的建议之外,您还需要在junit任务中设置依赖项

<junit ....> 
  <classpath>
     <pathelement path="testscripts" />
     <pathelement path="supportlibraries">
     <!-- Add other dependencies here. -->
  </classpath>
  <test name ="...">
  </test>
</junit>

从Junit上的ANT doco开始: