From 9c8a7ff16ebd9df91a7729e2820e4f34b02a0192 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Thu, 28 Mar 2024 15:05:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=96=AD=E8=A8=80=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/parser/jmeter/constants/JmeterAlias.java | 1 + .../api/parser/jmeter/constants/JmeterProperty.java | 1 + .../assertion/ScriptAssertionConverter.java | 13 ++++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/constants/JmeterAlias.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/constants/JmeterAlias.java index 01b71479e8..7a339359b1 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/constants/JmeterAlias.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/constants/JmeterAlias.java @@ -21,4 +21,5 @@ public class JmeterAlias { public static final String HEADER_PANEL = "HeaderPanel"; public static final String AUTH_PANEL = "AuthPanel"; public static final String ARGUMENTS_PANEL = "ArgumentsPanel"; + public static final String BEAN_SHELL_ASSERTION_GUI = "BeanShellAssertionGui"; } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/constants/JmeterProperty.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/constants/JmeterProperty.java index d884da0d0d..85d7e932d5 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/constants/JmeterProperty.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/constants/JmeterProperty.java @@ -9,4 +9,5 @@ public class JmeterProperty { public static final String CACHE_KEY = "cacheKey"; public static final String SCRIPT_LANGUAGE = "scriptLanguage"; public final static String ASS_OPTION = "ASS_OPTION"; + public final static String BEAN_SHELL_ASSERTION_QUERY = "BeanShellAssertion.query"; } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/assertion/ScriptAssertionConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/assertion/ScriptAssertionConverter.java index fda587205c..19095f4f96 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/assertion/ScriptAssertionConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/assertion/ScriptAssertionConverter.java @@ -1,5 +1,7 @@ package io.metersphere.api.parser.jmeter.processor.assertion; +import io.metersphere.api.parser.jmeter.constants.JmeterAlias; +import io.metersphere.api.parser.jmeter.constants.JmeterProperty; import io.metersphere.api.parser.jmeter.processor.ScriptProcessorConverter; import io.metersphere.plugin.api.dto.ParameterConfig; import io.metersphere.project.api.assertion.MsScriptAssertion; @@ -9,6 +11,7 @@ import io.metersphere.sdk.util.BeanUtils; import org.apache.commons.lang3.StringUtils; import org.apache.jmeter.assertions.BeanShellAssertion; import org.apache.jmeter.assertions.JSR223Assertion; +import org.apache.jmeter.save.SaveService; import org.apache.jmeter.testelement.TestElement; import org.apache.jorphan.collections.HashTree; @@ -25,13 +28,21 @@ public class ScriptAssertionConverter extends AssertionConverter