junit 4.12 学习笔记
来源:互联网 发布:精准扶贫大数据平台app 编辑:程序博客网 时间:2024/05/17 23:11
junit 4.12 学习笔记
概述
- 参考
- http://www.cnblogs.com/jinsdu/p/4646895.html
- https://www.ibm.com/developerworks/cn/education/java/j-junit4/index.html
Test—->测试
- TestCase—->Test
- junit.framework.TestCase.runBare—->按顺序执行setUp、runTest、tearDown
- junit.framework.TestCase.runTest—->最终通过反射调用
- TestSuite—->Test
- TestSuite为Test的组合模式,支持运行多个测试案例
Runner—->运行测试
- BlockJUnit4ClassRunner—->ParentRunner—->Runner
- ParentRunner提供通用过滤/排序/子元素集合/注解信息解析等支持
- BlockJUnit4ClassRunner为junit4运行的核心类,转换测试类的方法为一个个测试案例
- IgnoredClassRunner—->Runner
RunnerBuilder—->运行生成器支持
- IgnoredBuilder—->RunnerBuilder
- JUnit4Builder—->RunnerBuilder
JUnitCore—->运行支持
TestRule—->运行测试规则支持,允许在测试时,添加更多的行为控制
- Timeout—->TestRule
- org.junit.internal.runners.statements.FailOnTimeout.getResult—->通过FutureTask的超时等待完成超时Rule
TestResult/TestFailure/Result/Assert—->测试结果/断言支持
- Assert—->一系列的断言方法支持
常用注解支持
- Test—->标记public void 的方法为测试案例,支持timeout/expected
- Rule—->支持方法/类上应用特定的规则
- Ignore—->在方法或者类上禁用测试
- RunWith—->使用指定的Runner执行测试用例
- Before/BeforeClass—->单个/所有测试案例前执行动作
- After/AfterClass—->单个/所有测试案例后执行动作
其他支持—->监听器
- TestListenerTest—->TestListener—->测试过程中的事件监听
测试
- 示例代码位于– https://github.com/undergrowthlinear/2016MyBookSummary.git
- com.undergrowth.junit.TestAnnotation
阅读全文
0 0
- junit 4.12 学习笔记
- Junit 学习笔记
- JUnit学习笔记
- • Junit学习笔记
- JUnit学习笔记
- Junit学习笔记
- Junit学习笔记1
- Junit学习笔记
- Junit学习笔记
- Junit学习笔记_1
- JUnit Gossip学习笔记
- Junit学习笔记
- JUnit学习笔记
- JUnit学习笔记
- JUnit学习笔记
- junit学习笔记一
- Junit学习笔记
- Junit 4 学习笔记
- js设计模式--链式调用
- minimum subtree
- 【ERROR 1366 (HY000): Incorrect string value】(关键词:字符集/character set)
- <c语言经典100例>c3 完全平方数
- linux使用ultraedit的FTP的功能出现的不能初始化的问题
- junit 4.12 学习笔记
- Git上传项目至远程仓库与同步到本地
- NYOJ 599 奋斗的小蜗牛
- 文章标题
- 注册事件响应函数
- EventBus使用详解
- 数据类型
- AbstractQueuedSynchronizer源码剖析(五)- 响应中断的共享锁
- 定时检测网站运行状态