From 73828f3b09508034051f55909bc305607b1c48a2 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 25 May 2021 14:32:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E5=85=A5=E7=9A=84jmx=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=AD=EF=BC=8C=E4=BA=8B=E5=8A=A1=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E6=A0=B7=E5=BC=8F=E4=B8=8E=E9=A1=B5=E9=9D=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 导入的jmx脚本中,事务控制器样式与页面添加的保持一致 --- .../api/dto/automation/parse/MsJmeterParser.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java index e891088121..f9254a1f33 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java @@ -11,6 +11,7 @@ import io.metersphere.api.dto.definition.request.MsScenario; import io.metersphere.api.dto.definition.request.MsTestElement; import io.metersphere.api.dto.definition.request.assertions.*; import io.metersphere.api.dto.definition.request.controller.MsLoopController; +import io.metersphere.api.dto.definition.request.controller.MsTransactionController; import io.metersphere.api.dto.definition.request.controller.loop.CountController; import io.metersphere.api.dto.definition.request.controller.loop.MsForEachController; import io.metersphere.api.dto.definition.request.controller.loop.MsWhileController; @@ -53,6 +54,7 @@ import org.apache.jmeter.assertions.*; import org.apache.jmeter.config.ConfigTestElement; import org.apache.jmeter.control.ForeachController; import org.apache.jmeter.control.LoopController; +import org.apache.jmeter.control.TransactionController; import org.apache.jmeter.control.WhileController; import org.apache.jmeter.extractor.JSR223PostProcessor; import org.apache.jmeter.extractor.RegexExtractor; @@ -742,6 +744,12 @@ public class MsJmeterParser extends ApiImportAbstractParser { countController.setInputVal(foreachController.getInputValString()); countController.setReturnVal(foreachController.getReturnValString()); ((MsLoopController) elementNode).setForEachController(countController); + }else if(key instanceof TransactionController){ + TransactionController transactionController = (TransactionController) key; + elementNode = new MsTransactionController(); + elementNode.setName(transactionController.getName()); + ((MsTransactionController)elementNode).setGenerateParentSample(transactionController.isGenerateParentSample()); + ((MsTransactionController)elementNode).setIncludeTimers(transactionController.isIncludeTimers()); } // 平台不能识别的Jmeter步骤 else {