怎样将eclipse与Cactus集成,做Container内的单元测试?

Cactus是apache的一个开源测试框架,它是建立在junit 的基础上,它的功能比junit 强大的多,它可以做服务器端的测试,特别是Container 内的测试,它是一个自动测试框架,经过一段时间的研究,将我的心得写下来供大家参考。

首先需要的资源如下:

1 . Eclipse SDK Version: 3.1.2

2.  需要的类库有:aspectjrt-1.2.1.jar,  cactus-1.7.1.jar ,commons-httpclient-2.0.2.jar,commons-digester.jar,httpunit-1.6.jar, junit.jar。

3. 将服务器与eclipse集成(可选,集成进来的主要目的是可以实现debug)

下面是需要编写的文件资源:

1。cactus.properties

################################################################################

# Configuration file for Cactus.

# Each project using Cactus need to have such a file put in the CLASSPATH
# (Meaning the directory containgin this file should be in the CLASSPATH, not
# the file itself of course ... :) )

# Defines the URLs that will be used by Cactus to call it's redirectors
# (Servlet and JSP). You need to specify in these URLs the webapp context
# that you use for your application. In the example below, the context is
# "test".

cactus.servletRedirectorURL = http://localhost:7001/cactus/ServletRedirector
cactus.jspRedirectorURL = http://localhost:7001/cactus/JspRedirector
cactus.filterRedirectorURL = http://localhost:7001/cactus/FilterRedirector


# Name of Cactus property that specify the URL up to the webapp context.
# This is the base URL to call for t

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值