博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JUnit4 入门笔记
阅读量:4496 次
发布时间:2019-06-08

本文共 582 字,大约阅读时间需要 1 分钟。

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

转载于:https://www.cnblogs.com/vincenshen/p/10427839.html

你可能感兴趣的文章
TEA对称加密算法
查看>>
Dell笔记本刷回低版本bios的方法
查看>>
redis资料
查看>>
《自己动手写docker》之namespace部门实验
查看>>
Vim学习总结
查看>>
maven也是Apache开发的,也是java开发的。maven需要你本地系统JDK的支持
查看>>
垂直同步v-sync
查看>>
const关键字祥解
查看>>
JDK提供的并发工具类
查看>>
jmx
查看>>
【JZOJ4161】于神之怒 莫比乌斯反演
查看>>
实践作业4:Web测试实践(小组作业)每日任务记录2
查看>>
kubernetes 之一些报错
查看>>
PHP isset()、empty()、is_null()的使用区别详解
查看>>
软件产品案例分析(团队)
查看>>
eclipse中svn插件的安装
查看>>
北京赛区总结
查看>>
Mysql安装后的一些设置
查看>>
4、Qt Project之串口数据传输
查看>>
Python List reverse()方法
查看>>