fix(接口测试): 修复多线程组JMX导入模块创建错误问题

--bug=1022727 --user=赵勇 【接口测试】导入多线程的jmx文件,自动生成的模块名称是null https://www.tapd.cn/55049933/s/1334194
This commit is contained in:
fit2-zhao 2023-02-13 10:52:30 +08:00 committed by fit2-zhao
parent 4c1cb6c0f9
commit 23b343bd85
2 changed files with 6 additions and 10 deletions

View File

@ -286,15 +286,9 @@ public class JmeterDefinitionParser extends ApiImportAbstractParser<ApiDefinitio
apiDefinition.setName(element.getName());
apiDefinition.setProjectId(this.projectId);
apiDefinition.setRequest(JSON.toJSONString(element));
/* if (this.apiModule != null) {
apiDefinition.setModuleId(this.apiModule.getId());
if (StringUtils.isNotBlank(this.selectModulePath)) {
apiDefinition.setModulePath(this.selectModulePath + "/" + this.apiModule.getName());
} else {
apiDefinition.setModulePath("/" + this.apiModule.getName());
}
}*/
apiDefinition.setModulePath("/" + this.planName);
if (StringUtils.isNotBlank(this.planName)) {
apiDefinition.setModulePath("/" + this.planName);
}
// todo 除HTTP协议外其它协议设置默认模块
apiDefinition.setStatus("Prepare");
apiDefinition.setProtocol(protocol);

View File

@ -146,7 +146,9 @@ public class JMeterParser extends ApiImportAbstractParser<ScenarioImport> {
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));