diff --git a/backend/src/main/java/io/metersphere/api/service/APITestService.java b/backend/src/main/java/io/metersphere/api/service/APITestService.java index 10cf3ab666..f610ca0cb0 100644 --- a/backend/src/main/java/io/metersphere/api/service/APITestService.java +++ b/backend/src/main/java/io/metersphere/api/service/APITestService.java @@ -473,12 +473,37 @@ public class APITestService { List thirdHashTreeElementList = innerHashTreeElement.elements("hashTree"); for (Element element : thirdHashTreeElementList) { - if(updateHTTPSamplerProxyName){ - List sampleProxyElementList = element.elements("HTTPSamplerProxy"); - for (Element itemElement : sampleProxyElementList) { + List sampleProxyElementList = element.elements("HTTPSamplerProxy"); + for (Element itemElement : sampleProxyElementList) { + if(updateHTTPSamplerProxyName){ itemElement.attribute("testname").setText(testName); } } + List tcpSamplerList = element.elements("TCPSampler"); + for (Element itemElement : tcpSamplerList) { + if(updateHTTPSamplerProxyName){ + itemElement.attribute("testname").setText(testName); + } + } + List jdbcSamplerList = element.elements("JDBCSampler"); + for (Element itemElement : jdbcSamplerList) { + if(updateHTTPSamplerProxyName){ + itemElement.attribute("testname").setText(testName); + } + } + List 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 scriptHashTreeElementList = element.elements("hashTree"); for (Element scriptHashTreeElement : scriptHashTreeElementList) {