在ant中使用junit命令跑所有测试
2008-10-29 17:40
621 查看
<!--*************编译测试文件*****************-->
<target name="compile.functionalTest">
<mkdir dir="${build.dir}/functionalTest"/>
<javac srcdir="${basedir}/functionTest" destdir="${build.dir}/functionalTest" classpathref="app.classpath"/>
</target>
<!--******************************************-->
<target name="run.selenium.tests" depends="compile.functionalTest">
<mkdir dir="${basedir}/report" />
<!--**************这些属性可以参看ant的文档*************-->
<junit printsummary="on" haltonfailure="false" failureproperty="functional.tests.failed" showoutput="yes" reloading="false" fork="yes" forkmode="perBatch">
<classpath>
<!--**************这个路径指的是源文件编译后的class文件和配置文件*************-->
<pathelement path="${build.dir}/dest/WEB-INF/classes" />
<!--**************这个路径指的是测试文件编译后class文件*********************-->
<pathelement path="${build.dir}/functionalTest"/>
<!--**************这个路径指的是依赖的jar包*********************-->
<path refid="app.classpath" />
</classpath>
<formatter type="xml" />
<sysproperty key="log4j.configuration" value="log4j.properties" />
<sysproperty key="org.apache.commons.logging.Log" value="org.apache.commons.logging.impl.NoOpLog" />
<batchtest todir="${basedir}/report">
<fileset dir="${build.dir}/functionalTest">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
<fail if="functional.tests.failed" message="One or more tests failed. See test output for details" />
</target>
<target name="compile.functionalTest">
<mkdir dir="${build.dir}/functionalTest"/>
<javac srcdir="${basedir}/functionTest" destdir="${build.dir}/functionalTest" classpathref="app.classpath"/>
</target>
<!--******************************************-->
<target name="run.selenium.tests" depends="compile.functionalTest">
<mkdir dir="${basedir}/report" />
<!--**************这些属性可以参看ant的文档*************-->
<junit printsummary="on" haltonfailure="false" failureproperty="functional.tests.failed" showoutput="yes" reloading="false" fork="yes" forkmode="perBatch">
<classpath>
<!--**************这个路径指的是源文件编译后的class文件和配置文件*************-->
<pathelement path="${build.dir}/dest/WEB-INF/classes" />
<!--**************这个路径指的是测试文件编译后class文件*********************-->
<pathelement path="${build.dir}/functionalTest"/>
<!--**************这个路径指的是依赖的jar包*********************-->
<path refid="app.classpath" />
</classpath>
<formatter type="xml" />
<sysproperty key="log4j.configuration" value="log4j.properties" />
<sysproperty key="org.apache.commons.logging.Log" value="org.apache.commons.logging.impl.NoOpLog" />
<batchtest todir="${basedir}/report">
<fileset dir="${build.dir}/functionalTest">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
<fail if="functional.tests.failed" message="One or more tests failed. See test output for details" />
</target>
相关文章推荐
- 使用Junit测试一个 spring静态工厂实例化bean 的例子,所有代码都没有问题,但是出现java.lang.IllegalArgumentException异常
- 使用Ant进行Junit测试
- 使用Ant运行JUnit测试用例时,报java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing的一种解决方案
- 对基于JUnit和Ant的测试用例执行过程使用Kieker(AspectJ)进行监控的方法
- Ant 使用Junit自动测试要注意的问题
- 基于JUnit和Ant测试程序正在运行使用Kieker(AspectJ)监测方法
- 使用Ant与Junit进行自动化测试
- 使用Ant进行Junit测试
- 使用Ant+JUnit+Cobertura来实现代码覆盖自动测试
- 使用ant进行junit测试
- 使用Selenium 和Junit 进行WEB功能测试
- 使用Mock MVC来进行Controller 层的junit的测试
- 使用android stdio1.5进行junit测试
- 【SSH】Spring学习(二)使用注解配置Spring、安装STS插件、Spring与junit整合测试、AOP
- Android Instrument测试命令使用小记
- Java中的异常测试框架JUnit使用上手指南
- 使用JUnit&Ant生成UT报表
- Android中使用自身携带的Junit新建一个测试工程
- 使用批处理命令移动子目录下的所有文件到当前目录下,并删除子目录
- django 中 manage.py通常使用的各种命令大全(包含django 安装指导及测试)