Ant 使用Junit自动测试要注意的问题
来源:互联网 发布:final cut pro 7 mac 编辑:程序博客网 时间:2024/06/01 09:01
在构建Ant自动测试的时候,必须要加入ant_home/lib下的库,要不会出现ClassNotFound的异常。
<path id="test.classpath">
<fileset dir="${ant.library.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${test.home}/classes"/>
</path>
<target name="test" depends="all">
<mkdir dir="${test.report}"/>
<mkdir dir="${test.home}/classes"/>
<javac srcdir="${test.home}/src"
destdir="${test.home}/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="master-classpath"/>
</javac>
<junit printsummary="true"
fork="true"
haltonfailure="false"
failureproperty="tests.failed"
showoutput="true">
<classpath refid="test.classpath"/>
<classpath refid="master-classpath"/>
<formatter type="xml"/>
<batchtest todir="${test.report}">
<fileset dir="${test.home}/classes">
<include name="**/*Test.*"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.report}">
<fileset dir="${test.report}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.report}"/>
</junitreport>
<fail if="tests.failed">
---------------------------------------------------------
One or more tests failed, check the report for detail...
---------------------------------------------------------
</fail>
</target>
<fileset dir="${ant.library.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${test.home}/classes"/>
</path>
<target name="test" depends="all">
<mkdir dir="${test.report}"/>
<mkdir dir="${test.home}/classes"/>
<javac srcdir="${test.home}/src"
destdir="${test.home}/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="master-classpath"/>
</javac>
<junit printsummary="true"
fork="true"
haltonfailure="false"
failureproperty="tests.failed"
showoutput="true">
<classpath refid="test.classpath"/>
<classpath refid="master-classpath"/>
<formatter type="xml"/>
<batchtest todir="${test.report}">
<fileset dir="${test.home}/classes">
<include name="**/*Test.*"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.report}">
<fileset dir="${test.report}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.report}"/>
</junitreport>
<fail if="tests.failed">
---------------------------------------------------------
One or more tests failed, check the report for detail...
---------------------------------------------------------
</fail>
</target>
- Ant 使用Junit自动测试要注意的问题
- Ant+JUnit+Cobertura执行测试用例时,应注意的问题(以Apache POI为例)
- JUnit+ANT自动测试实验
- 使用Ant+JUnit+Cobertura来实现代码覆盖自动测试
- ant集成junit自动测试的build.xml标准模板
- 使用ant进行junit测试
- 使用ant进行junit测试
- 使用Ant进行Junit测试
- 使用Ant进行Junit测试
- Junit写测试自动rollback的问题
- ant结合junit进行软件自动测试
- ant+junit实现TDD,自动测试
- 用Ant自动测试JUnit(Ant测试自动化--上)
- Ant+junit的测试自动化
- Ant+junit的测试自动化
- Ant+junit的测试自动化
- Ant+junit的测试自动化
- 使用Ant与Junit进行自动化测试
- dfg
- 不用JAVA基本类库把一字符串转成长整数的基本方法
- Tomcat5.5配置-多域名绑定
- testtttttt
- sql字符串处理函数
- Ant 使用Junit自动测试要注意的问题
- .NET发布的疑问?
- asp.net生成htm
- 使用XML 专栏
- 一道google笔试题以及解答
- JAVA生成一年十二月SQL代码
- 关于开发与配置的随想
- vc++.net下使用水晶报表
- 你,为什么总富不起来?