轻量级性能测试工具ContiPerf
使用java进行脚本开发的测试童鞋有福了,不仅自动化能做,性能测试也能做:
轻量级性能测试工具ContiPerf :
ContiPerf 是一个轻量级的测试工具能轻松地利用的JUnit 4的性能测试,测试案例,例如连续性能测试。它的灵感来自JUnit 4中与注释简单测试配置,以及用JUnitPerf的包装性能测试单元测试的想法,但更强大和更容易使用。它使用定义测试执行的特点和性能要求的Java注解。您可以标记一个测试运行一定次数,或将不断提出一定的时间执行。
示例测试代码:
import org.junit.*; import org.databene.contiperf.*; public class SmokeTest { @Rule public ContiPerfRule i = new ContiPerfRule(); @Test @PerfTest(invocations = 1000, threads = 20) @Required(max = 1200, average = 250) public void test1() throws Exception { Thread.sleep(200); } } |
最新内容请见作者的GitHub页:http://qaseven.github.io/