From 23b343bd854b5d9287c43e4d6ecfbb04805a4f08 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 13 Feb 2023 10:52:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E7=BA=BF=E7=A8=8B=E7=BB=84JMX?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A8=A1=E5=9D=97=E5=88=9B=E5=BB=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1022727 --user=赵勇 【接口测试】导入多线程的jmx文件,自动生成的模块名称是null https://www.tapd.cn/55049933/s/1334194 --- .../api/parse/api/JmeterDefinitionParser.java | 12 +++--------- .../metersphere/api/parse/scenario/JMeterParser.java | 4 +++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/JmeterDefinitionParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/JmeterDefinitionParser.java index a635c7291b..b7ab7a0212 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/JmeterDefinitionParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/JmeterDefinitionParser.java @@ -286,15 +286,9 @@ public class JmeterDefinitionParser extends ApiImportAbstractParser { scenarioWithBLOBs.setProjectId(request.getProjectId()); if (msScenario != null && CollectionUtils.isNotEmpty(msScenario.getHashTree())) { scenarioWithBLOBs.setStepTotal(msScenario.getHashTree().size()); - scenarioWithBLOBs.setModulePath("/" + msScenario.getName()); + if (StringUtils.isNotBlank(msScenario.getName())) { + scenarioWithBLOBs.setModulePath("/" + msScenario.getName()); + } } scenarioWithBLOBs.setId(UUID.randomUUID().toString()); scenarioWithBLOBs.setScenarioDefinition(JSON.toJSONString(msScenario));