From dd78428f0af0d2214d285d1f534bcc5392baf80f Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 29 Nov 2022 16:47:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=AF=BC=E5=85=A5=E6=8E=A5=E5=8F=A3=E6=88=96?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E9=BB=98=E8=AE=A4=E5=90=AF=E7=94=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/parse/api/JmeterDefinitionParser.java | 44 ++++++------------- 1 file changed, 14 insertions(+), 30 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 f60dff036b..18cfdaa442 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 @@ -7,12 +7,7 @@ import io.github.ningyu.jmeter.plugin.util.Constants; import io.metersphere.api.dto.ApiTestImportRequest; import io.metersphere.api.dto.automation.ImportPoolsDTO; import io.metersphere.api.dto.definition.request.MsScenario; -import io.metersphere.api.dto.definition.request.assertions.MsAssertionDuration; -import io.metersphere.api.dto.definition.request.assertions.MsAssertionJSR223; -import io.metersphere.api.dto.definition.request.assertions.MsAssertionJsonPath; -import io.metersphere.api.dto.definition.request.assertions.MsAssertionRegex; -import io.metersphere.api.dto.definition.request.assertions.MsAssertionXPath2; -import io.metersphere.api.dto.definition.request.assertions.MsAssertions; +import io.metersphere.api.dto.definition.request.assertions.*; import io.metersphere.api.dto.definition.request.extract.MsExtract; import io.metersphere.api.dto.definition.request.extract.MsExtractJSONPath; import io.metersphere.api.dto.definition.request.extract.MsExtractRegex; @@ -43,22 +38,13 @@ import io.metersphere.commons.constants.PropertyConstant; import io.metersphere.commons.constants.RequestTypeConstants; import io.metersphere.commons.enums.ApiTestDataStatus; import io.metersphere.commons.exception.MSException; -import io.metersphere.commons.utils.BeanUtils; -import io.metersphere.commons.utils.CommonBeanFactory; -import io.metersphere.commons.utils.JSON; -import io.metersphere.commons.utils.LogUtil; -import io.metersphere.commons.utils.SessionUtils; +import io.metersphere.commons.utils.*; import io.metersphere.environment.service.BaseEnvironmentService; import io.metersphere.plugin.core.MsTestElement; import io.metersphere.request.BodyFile; -import io.metersphere.commons.utils.JSONUtil; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.jmeter.assertions.DurationAssertion; -import org.apache.jmeter.assertions.JSONPathAssertion; -import org.apache.jmeter.assertions.JSR223Assertion; -import org.apache.jmeter.assertions.ResponseAssertion; -import org.apache.jmeter.assertions.XPath2Assertion; +import org.apache.jmeter.assertions.*; import org.apache.jmeter.config.ConfigTestElement; import org.apache.jmeter.extractor.JSR223PostProcessor; import org.apache.jmeter.extractor.RegexExtractor; @@ -82,18 +68,14 @@ import org.apache.jorphan.collections.HashTree; import java.io.InputStream; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; public class JmeterDefinitionParser extends ApiImportAbstractParser { private final Map> headerMap = new HashMap<>(); private ImportPoolsDTO dataPools; private final String ENV_NAME = "导入数据环境"; + private static final String P0 = "P0"; private String planName = PropertyConstant.DEFAULT; @@ -128,20 +110,22 @@ public class JmeterDefinitionParser extends ApiImportAbstractParser