JUnit4 入门笔记
2024-10-21 14:29:19
Test注解的两个可选参数 expected timeout
The Test annotation supports two optional parameters.
The first, expected, declares that a test method should throw an exception.
If it doesn't throw an exception or if it throws a different exception than the one declared, the test fails.
@Test(expected = Exception.class)
public void Test() {
}
The second optional parameter, timeout, causes a test to fail if it takes longer than a specified amount of clock time (measured in milliseconds).
@Test(timeout = 1000)
public void Test() {
}
最新文章
- 四、jquery中的事件与应用
- (C#)使用NPOI导出Excel
- Thrift简单实践
- 前端常用的几个js判断(二)
- 1、基于MFC的OpenGL程序
- MyBatis 一级缓存与二级缓存
- Windows 和 Linux 下 禁止ping的方法
- float:left居中对齐
- POJ 1650
- Android Studio 单刷《第一行代码》系列 01 —— 第一战 HelloWorld
- Competing in a data science contest without reading the data
- bzoj3907: 网格
- 设计一个程序能够将某一个目录下面的所有文件名打印出来---File类的使用
- EntityFramework6与EntityFrameworkCore的区别
- c/c++ 动态库与静态库的制作和使用
- Django rest framework源码分析(1)----认证
- 【弱省胡策】Round #5 Count
- nodejs连接数据库的增删改查
- 关于hibernate总是报错 配置factory的id找不到,mapping配置文件Could not parse mapping document from input stream
- .net(C#)常见面试题