easymock的使用,含demo

上传者: chunecai | 上传时间: 2021-09-04 21:02:45 | 文件大小: 607KB | 文件类型: ZIP
EasyMock 是一套通过简单的方法对于指定的接口或类生成 Mock 对象的类库,它能利用对接口或类的模拟来辅助单元测试。本文将对 EasyMock 的功能和原理进行介绍,并通过示例来说明如何使用 EasyMock 进行单元测试。 Mock 方法是单元测试中常见的一种技术,它的主要作用是模拟一些在应用中不容易构造或者比较复杂的对象,从而把测试与测试边界以外的对象隔离开。 编写自定义的 Mock 对象需要额外的编码工作,同时也可能引入错误。EasyMock 提供了根据指定接口动态构建 Mock 对象的方法,避免了手工编写 Mock 对象。本文将向您展示如何使用 EasyMock 进行单元测试,并对 EasyMock 的原理进行分析。

文件下载

资源详情

[{"title":"( 28 个子文件 607KB ) easymock的使用,含demo","children":[{"title":"EasyMock","children":[{"title":"EasyMock IBM Doc.doc <span style='color:#111;'> 297.50KB </span>","children":null,"spread":false},{"title":"Easy+Mock","children":[{"title":"Easy Mock","children":[{"title":"用mock object进行隔离测试.docx <span style='color:#111;'> 19.24KB </span>","children":null,"spread":false},{"title":"EasyMock使用简明手册 .doc <span style='color:#111;'> 35.00KB </span>","children":null,"spread":false},{"title":"EasyMock使用技巧.doc <span style='color:#111;'> 66.50KB </span>","children":null,"spread":false},{"title":"EasyMock使用说明.doc <span style='color:#111;'> 55.50KB </span>","children":null,"spread":false},{"title":"EasyMock如何打桩.doc <span style='color:#111;'> 159.00KB </span>","children":null,"spread":false},{"title":"EasyMock实践指南 .doc <span style='color:#111;'> 47.50KB </span>","children":null,"spread":false},{"title":"EasyMock单元测试的扩展:mock object.doc <span style='color:#111;'> 29.50KB </span>","children":null,"spread":false},{"title":"Easy Mock.doc <span style='color:#111;'> 174.00KB </span>","children":null,"spread":false},{"title":"EasyMock使用手记 .doc <span style='color:#111;'> 153.00KB </span>","children":null,"spread":false},{"title":"EasyMock来进行测试 .doc <span style='color:#111;'> 337.50KB </span>","children":null,"spread":false},{"title":"EasyMock简介(抽象类接口做测试).doc <span style='color:#111;'> 103.50KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"EasyMockDemo","children":[{"title":"EasyMockDemo","children":[{"title":".project <span style='color:#111;'> 388B </span>","children":null,"spread":false},{"title":"EasyMockDemoLib","children":[{"title":".project <span style='color:#111;'> 219B </span>","children":null,"spread":false},{"title":"junit-4.2.jar <span style='color:#111;'> 125.26KB </span>","children":null,"spread":false},{"title":"easymock-2.3.jar <span style='color:#111;'> 68.18KB </span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'> 445B </span>","children":null,"spread":false},{"title":".checkstyle <span style='color:#111;'> 308B </span>","children":null,"spread":false},{"title":"org","children":[{"title":"easymock","children":[{"title":"demo","children":[{"title":"domain","children":[{"title":"SalesOrderImpl.java <span style='color:#111;'> 3.01KB </span>","children":null,"spread":false},{"title":"DBUtility.class <span style='color:#111;'> 295B </span>","children":null,"spread":false},{"title":"DBUtility.java <span style='color:#111;'> 699B </span>","children":null,"spread":false},{"title":"SalesOrderImpl.class <span style='color:#111;'> 2.52KB </span>","children":null,"spread":false},{"title":"SalesOrder.java <span style='color:#111;'> 844B </span>","children":null,"spread":false},{"title":"SalesOrder.class <span style='color:#111;'> 468B </span>","children":null,"spread":false}],"spread":true},{"title":"matcher","children":[{"title":"SQLEquals.java <span style='color:#111;'> 788B </span>","children":null,"spread":false},{"title":"SQLEquals.class <span style='color:#111;'> 1.34KB </span>","children":null,"spread":false}],"spread":true},{"title":"testcase","children":[{"title":"SalesOrderTestCase.class <span style='color:#111;'> 3.16KB </span>","children":null,"spread":false},{"title":"SalesOrderTestCase.java <span style='color:#111;'> 2.74KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明