`
xitong
  • 浏览: 6401780 次
文章分类
社区版块
存档分类
最新评论

JUnitPerf 之Timed Tests

 
阅读更多

1.1)to create a timed test that waits for the completion of the ExampleTestCase.testOneSecondResponse() method and then fails if the elapsed time exceeded 1 second

Code example:

long maxElapsedTime = 1000;
Test testCase = new ExampleTestCase("testOneSecondResponse");
Test timedTest = new TimedTest(testCase, maxElapsedTime);

1.2)产生一个Non-Waiting Timed Tests

to create a timed test that fails immediately when the elapsed time of the ExampleTestCase.testOneSecondResponse() test method exceeds 1 second

Code example:

long maxElapsedTime = 1000;
Test testCase = new ExampleTestCase("testOneSecondResponse");
Test timedTest = new TimedTest(testCase, maxElapsedTime, false);

源文档 <http://www.clarkware.com/software/JUnitPerf.html>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics