- 入门
- 定义期望
- 模拟方法的返回值
- 从模拟方法抛出异常
- 匹配参数值
- 精确指定期望参数匹配值
- 期望方法多于(少于)一次
- 期望调用顺序
- 期望一个调用在两个其他调用之间
- 忽略不相关的模拟对象
- 在测试的Set-Up中覆盖期望定义
- 匹配对象和方法
- 编写新的匹配器
- 编写新的行为
- 使用脚本轻松定义行为
- 使用模拟对象测试多线程代码
- 模拟泛型
- 模拟抽象的和实际类
- 使用非Java语言来使用jMock
- 更新jMock 1到jMock 2
- 在Maven构建中使用jMock
- 理解jMock 2中的方法调度
- 在Eclipse 插件测试中模拟类
jMock Cookbook 原文地址:
- Get Started
- Define Expectations
- Return Values from Mocked Methods
- Throw Exceptions from Mocked Methods
- Match Parameter Values
- Precisely Specify Expected Parameter Values
- Expect Methods More (or Less) than Once
- Expect a Sequence of Invocations
- Expect an Invocation Between Two Other Invocations
- Ignore Irrelevant Mock Objects
- Override Expectations Defined in the Test Set-Up
- Match Objects and Methods
- Write New Matchers
- Write New Actions
- Easily Define Actions with Scripts
- Test Multithreaded Code with Mock Objects
- Mock Generic Types
- Mock Abstract and Concrete Classes
- Use jMock with Languages Other Than Java
- Upgrade from jMock 1 to jMock 2
- Use jMock in Maven Builds
- Understand method dispatch in jMock 2
- Mock Classes in Eclipse Plug-in Tests
Link:http://blog.csdn.net/zhengsj/article/details/3438862