首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > JUnit线导体在JUnit测试管理线程

JUnit线导体在JUnit测试管理线程

  • 资源大小:10.65 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 线程 测试 junit 管理

资 源 简 介

This is a very simple and small (~250 LOC) library for writing concurrency tests with JUnit (tested with JUnit 4.10). There are 2 ways of using it: ConcurrentTestRunner If you want to run a test concurrently multiple times, just use the ConcurrentTestRunner. Optionally, the number of threads and a timeout can be specified either with @ConcurrentTest for all tests in a class or with @ConcurrentTestMethod for a specific test-method. By default, numThreads is set to 10 and timeout is set to 0, disabling the timeout. ``` @RunWith(ConcurrentTestRunner.class) public class ConcurrentTestRunnerTest { @Test public void testRun10TimesByDefault() { System.out.println("This is going to be printed 10 times."); } @Test @ConcurrentTestMethod(numThreads = 20, timeout = 100) public void testRun20TimesByDefault() { System.out.println("This is going to be printed 20 times an
VIP VIP
0.177691s