【发布时间】:2011-11-30 16:44:17
【问题描述】:
我有一个 gwt 项目,我想在我的项目中进行单元测试,所以我在 ant 构建文件中添加了 junit 的目标。但是构建总是失败,
BUILD FAILED C:\SG\workspace\app\build.xml:78: 如果不在 Ant 自己的类路径中,for 必须包含 junit.jar
这是脚本
<target name="test" depends="clean.test,gwtc" description="run all Junit tests">
<mkdir dir ="test/test"/>
**<junit fork = "false" printsummary = "yes"/>** <!-- the line 78-->
<classpath refid = "project.class.path"/>
<batchtest todir = "test/test">
<fileset dir = "test" includes="**/${test}Test.java"/>
</batchtest>
<formatter type = "xml"/>
<junitreport toDir = "test/test">
<fileset dir = "test/test"/>
<report format="frames" todir="test"/>
</junitreport>
<exec os="window" executable="cmd.exe">
<arg line="-a /Applications/Safari.app test/index.html"/>
</exec>
</target>
【问题讨论】:
-
您忘记添加脚本