持续集成 Java手册

持续集成 Java手册

一、概念

Martin Fowler的文章:Continuous Integration  中文翻译:持续集成

二、工具

传统工具:JBuilder,VisualSourceSafe,Rational ClearCase

自动编译工具:Ant

回归测试工具:JUnit

代码检查工具:CheckStyle

持续集成工具:CruiseControl

三、步骤

  • CruiseControl监控远程版本控制系统的变化

  • 变化发生时CruiseControl调用编译工具进行编译(Ant等)

  • 编译成功后调用JUnit进行回归测试

  • 编译成功后调用CheckStyle进行代码检查

  • 打包,部署,更新版本控制系统

  • 完毕后将编译结果、测试结果、代码检查结果发送至开发人员、主管经理,并发布至网站,甚至报警器

    所有这一切都是按照编制好的脚本自动进行的

四、实施示例

目前我们使用的是ClearCase,主控软件为CruiseControl,其脚本文件为cccc.xml

  • 配置远程版本控制系统

<modificationset quietperiod="60">

  <clearcase branch="main" viewpath="D:/cc_view/chelseafc/Nucleus2.0/Port" recursive="true" />

</modificationset>

  • 配置编译工具

<schedule interval="60">

  <ant antscript="C:/Java/JBuilder2005/thirdparty/ant/bin/ant.bat" buildfile="D:/cc_view/chelseafc/Nucleus2.0/Port/clearcase-build.xml" target="cleanbuild" multiple="1" />

</schedule>

  • 配置测试用例(在ant的配置文件中)

<target name="test" depends="init" description="Run unit tests">

  <delete dir="${junit.results}" />

  <mkdir dir="${junit.results}" />

  <junit fork="yes" haltonfailure="yes">

  <classpath refid="project.class.path" />

  <formatter type="

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

chelsea

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值