From 2a4f102d4da3b9f84765717f20ad3a32208f957e Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 11 Dec 2024 22:16:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95CriticalSectionControlle?= =?UTF-8?q?r=20LogicController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parse/xml/reader/JmeterDocumentParser.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java b/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java index e99184b9e5..766f9d9456 100644 --- a/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java +++ b/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java @@ -238,17 +238,11 @@ public class JmeterDocumentParser implements EngineSourceParser { } private void processCriticalSectionController(Element element) { - Element parent = element.getParent(); - Element hashTree = getNextSibling(element); -// 删除CriticalSectionController 和 hashTree - element.detach(); - hashTree.detach(); -// 添加一个LogicController - Element sampleController = parent.addElement("GenericController"); - sampleController.addAttribute("guiclass", "LogicControllerGui"); - sampleController.addAttribute("testclass", "GenericController"); - sampleController.addAttribute("testname", element.attributeValue("testname")); - parent.add(hashTree); + element.setName("GenericController"); + element.addAttribute("guiclass", "LogicControllerGui"); + element.addAttribute("testclass", "GenericController"); + element.addAttribute("testname", element.attributeValue("testname").replace("Csc_", "")); + removeChildren(element); }