fix: 修改生成jmx文件函数的逻辑,转化Dubbl标签的参数

修改生成jmx文件函数的逻辑,转化Dubbl标签的参数
This commit is contained in:
song.tianyang 2021-02-20 18:08:28 +08:00
parent 567ae41aa3
commit 1383ca4d5a
1 changed files with 28 additions and 3 deletions

View File

@ -473,12 +473,37 @@ public class APITestService {
List<Element> thirdHashTreeElementList = innerHashTreeElement.elements("hashTree");
for (Element element : thirdHashTreeElementList) {
if(updateHTTPSamplerProxyName){
List<Element> sampleProxyElementList = element.elements("HTTPSamplerProxy");
for (Element itemElement : sampleProxyElementList) {
if(updateHTTPSamplerProxyName){
itemElement.attribute("testname").setText(testName);
}
}
List<Element> tcpSamplerList = element.elements("TCPSampler");
for (Element itemElement : tcpSamplerList) {
if(updateHTTPSamplerProxyName){
itemElement.attribute("testname").setText(testName);
}
}
List<Element> jdbcSamplerList = element.elements("JDBCSampler");
for (Element itemElement : jdbcSamplerList) {
if(updateHTTPSamplerProxyName){
itemElement.attribute("testname").setText(testName);
}
}
List<Element> dubboSampleList = element.elements("DubboSample");
for (Element itemElement : dubboSampleList) {
if(updateHTTPSamplerProxyName){
itemElement.attribute("testname").setText(testName);
}
//dubbo节点要更新 标签guiClass testClass
itemElement.setName("io.github.ningyu.jmeter.plugin.dubbo.sample.DubboSample");
itemElement.attribute("testclass").setText("io.github.ningyu.jmeter.plugin.dubbo.sample.DubboSample");
itemElement.attribute("guiclass").setText("io.github.ningyu.jmeter.plugin.dubbo.gui.DubboSampleGui");
}
//检查有没有自定义参数
List<Element> scriptHashTreeElementList = element.elements("hashTree");
for (Element scriptHashTreeElement : scriptHashTreeElementList) {