性能测试工具 idea + maven + jmeter 实现 java 请求性能测试

另一种蓝 · 2018年08月23日 · 1994 次阅读

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.log.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSmsDataResource extends AbstractJavaSamplerClient{

private static ClassPathXmlApplicationContext cxt = new ClassPathXmlApplicationContext("test-perf.xml");
private static final Log log = LogFactory.getLog(TestPaySmsDataResource.class);
private static SmsDataResource SmsDataResource = (SmsDataResource) cxt.getBean("SmsDataResource"

@Override
public SampleResult runTest(JavaSamplerContext javaSamplerContext){
SampleResult sampleResult = new SampleResult();

return sampleResult;
}

@Override
public Arguments getDefaultParameters(){
Arguments params = new Arguments();
return params;
}

@Override
protected Logger getLogger(){
return super.getLogger();
}

@Override
public void setupTest(JavaSamplerContext context){
super.setupTest(context);
}

@Override
public void teardownTest(JavaSamplerContext context){
super.teardownTest(context);
}

}

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册