ant + junit 接口测试
来源:互联网 发布:多功能网络线材测试仪 编辑:程序博客网 时间:2024/06/06 01:40
应项目需求,用junit写了个接口测试
又要求部署到jenkins上,打包之前用ant跑一遍测试用例
于是,ant小白折腾了一个礼拜,终于搞定
期间遇到了各种问题,修改了无数次build.xml。最终版build.xml如下
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><project name="E7-Planning" default="junit" basedir="."><!-- ================================================ --><!-- 变量设置 --><!-- ================================================ --><!-- 源代码src路径 --><property name="src.path" value="${basedir}\src"/><!-- 编译文件class路径 --><property name="build.path" value="${basedir}\build"/><!--测试代码路径--><property name="test.path" value="${basedir}\test"/><!--lib包路径--><property name="lib.path" value="${basedir}\WebContent\WEB-INF\lib"/><!-- resource --><property name="resource.path" value="${basedir}\resource"/><!-- 生成报告junit.xml路径 --><property name="report.path" value="${basedir}\report"/><!-- ant --><property name="ant.path" value="C:\install\apache-ant-1.10.1\lib"/><property name="run.jvmargs.ide" value=""/><!-- ================================================ --><!-- 设置classpath --><!-- ================================================ --><path id="compile.path"><fileset dir="${lib.path}"><include name="**\*.jar"/></fileset><fileset dir="${ant.path}"><include name="**\*.jar"/></fileset><pathelement path="compile.path"/></path><!-- ============================================== --><!-- 清除历史编译class --><!-- ============================================== --><target name="clean" description="clean"><delete dir="${build.path}"/></target><target name="mkdir" depends="clean" description="创建初始化目录结构" ><echo message="mkdir"/><mkdir dir="${build.path}/classes" /><mkdir dir="${report.path}" /></target><!-- ============================================== --><!-- 编译测试文件,初始化目录 --><!-- ============================================== --><target name="compile" description="mkdir"><echo message="begin compile..."/><javac srcdir="${src.path}" destdir="${build.path}/classes" classpathref="compile.path" includeantruntime="true" encoding="UTF-8" nowarn="on"/><javac srcdir="${test.path}" destdir="${build.path}/classes" classpathref="compile.path" includeantruntime="true" encoding="UTF-8" nowarn="on"><compilerarg value="-XDignore.symbol.file"/></javac><copy todir="${build.path}/classes"><fileset dir="${resource.path}"><include name="**/*.xml"/><include name="**/*.properties"/><include name="**/*.data"/><include name="**/*.license"/></fileset></copy><echo message="end compile..."/></target><!-- ============================================== --><!-- 打包 --><!-- ============================================== --><!-- <target name="jar" depends="compile"><jar destfile="resource.jar" basedir="${resource.path}"/><copy todir="${lib.path}\WEB-INF\lib"><fileset dir="${resource.path}"><include name="resource.jar"/></fileset></copy></target> --><!-- ============================================== --><!-- 执行测试案例 --><!-- ============================================== --><target name="junit" depends="clean,mkdir,compile"><junit fork="no" printsummary="true" showoutput="yes"><formatter type="xml" usefile="true"/><classpath><pathelement location="${build.path}/classes"/><path refid="compile.path"/></classpath><test name="com.epoch.planning.usecase.UseCase" todir="${report.path}" fork="no"/></junit></target><!-- 产生测试报告文档 --><target name="delete"><delete dir="${report.path}"/></target></project>
阅读全文
1 0
- ant + junit 接口测试
- ANT+JUnit自动化测试
- ant junit 单个测试
- ant+junit 测试一
- Ant+junit的测试自动化
- Ant+junit的测试自动化
- Ant+junit的测试自动化
- Ant+junit的测试自动化
- JUnit+ANT自动测试实验
- 使用ant进行junit测试
- 使用ant进行junit测试
- 用ANT执行JUNIT测试
- 使用Ant进行Junit测试
- ant整合junit自动化测试
- 使用Ant进行Junit测试
- 用Ant执行Junit测试
- ant+jmeter接口测试
- 用Ant自动测试JUnit(Ant测试自动化--上)
- setting的的配置参数
- MyEclipse中tomcat的配置以及部署工程到tomcat上
- RxJava2和Retorfit2引用依赖问题
- Android Service完全解析,关于服务你所需知道的一切(下)
- C++多线程——线程同步
- ant + junit 接口测试
- JRebel热部署神器的配置(Eclipse,非教程,就自己看看)
- 将两个有序数列组合成一个有序数列
- 【Python】Python3 字典 fromkeys()方法
- 操作系统页面置换算法与redis的内存淘汰机制
- android-Data Binding+recycleview打造二三级都可以选择的三级列表
- 安卓高德地图点聚合功能
- 深度学习--防止过拟合的几种方法
- Android多屏幕适配及自适应解决方案