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() {
}

最新文章

  1. 四、jquery中的事件与应用
  2. (C#)使用NPOI导出Excel
  3. Thrift简单实践
  4. 前端常用的几个js判断(二)
  5. 1、基于MFC的OpenGL程序
  6. MyBatis 一级缓存与二级缓存
  7. Windows 和  Linux 下 禁止ping的方法
  8. float:left居中对齐
  9. POJ 1650
  10. Android Studio 单刷《第一行代码》系列 01 —— 第一战 HelloWorld
  11. Competing in a data science contest without reading the data
  12. bzoj3907: 网格
  13. 设计一个程序能够将某一个目录下面的所有文件名打印出来---File类的使用
  14. EntityFramework6与EntityFrameworkCore的区别
  15. c/c++ 动态库与静态库的制作和使用
  16. Django rest framework源码分析(1)----认证
  17. 【弱省胡策】Round #5 Count
  18. nodejs连接数据库的增删改查
  19. 关于hibernate总是报错 配置factory的id找不到,mapping配置文件Could not parse mapping document from input stream
  20. .net(C#)常见面试题

热门文章

  1. OA办公管理系统最全设计
  2. AderTemplate
  3. Android 触摸及手势操作GestureDetector
  4. linux mysql 新增用户 分配权限
  5. JS制作一个通用的商城版历史浏览记录
  6. 第三课作业——set类型、sorted set类型的增删改查,redis的事务
  7. 被Chrome下的remove闪了一下腰
  8. IOS And WCF 上传文件
  9. shell脚本读取文件+读取命令行参数+读取标准输入+变量赋值+输出到文件
  10. 《深入理解Linux内核》阅读笔记 --- 第四章 中断和异常