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

相关文章:

  • 2021-09-12
  • 2021-12-17
  • 2021-06-21
  • 2021-12-03
  • 2021-11-30
  • 2021-12-22
  • 2021-12-15
  • 2021-11-20
猜你喜欢
  • 2021-11-26
  • 2021-07-22
  • 2021-04-07
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
相关资源
相似解决方案