From bccc995fd1f5c095250c60eb96f26c7a7547fd15 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 7 Mar 2023 14:27:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=AF=BC=E5=87=BAJMX=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=BD=AE=E5=90=8D=E7=A7=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023228 --user=赵勇 【接口测试】导入附件中的脚本执行,步骤1和7执行了,但是报告里显示的是pending https://www.tapd.cn/55049933/s/1346067 Signed-off-by: fit2-zhao --- .../java/io/metersphere/commons/utils/DataFormattingUtil.java | 4 ++++ .../backend/src/main/resources/i18n/messages_en_US.properties | 4 +++- .../backend/src/main/resources/i18n/messages_zh_CN.properties | 3 ++- .../backend/src/main/resources/i18n/messages_zh_TW.properties | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/DataFormattingUtil.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/DataFormattingUtil.java index d6b6c93645..f8a51b188b 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/DataFormattingUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/DataFormattingUtil.java @@ -10,9 +10,11 @@ import io.metersphere.base.domain.FileMetadata; import io.metersphere.base.mapper.FileMetadataMapper; import io.metersphere.commons.constants.ElementConstants; import io.metersphere.environment.service.BaseEnvironmentService; +import io.metersphere.i18n.Translator; import io.metersphere.metadata.service.FileMetadataService; import io.metersphere.request.BodyFile; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.RegExUtils; import org.apache.commons.lang3.StringUtils; import org.apache.jorphan.collections.HashTree; import org.aspectj.util.FileUtil; @@ -168,6 +170,8 @@ public class DataFormattingUtil { jmx = StringUtils.replace(jmx, " guiclass=\"DubboSampleGui\" ", " guiclass=\"io.github.ningyu.jmeter.plugin.dubbo.gui.DubboSampleGui\" "); jmx = StringUtils.replace(jmx, " guiclass=\"DubboDefaultConfigGui\" ", " guiclass=\"io.github.ningyu.jmeter.plugin.dubbo.gui.DubboDefaultConfigGui\" "); jmx = StringUtils.replace(jmx, " testclass=\"DubboSample\" ", " testclass=\"io.github.ningyu.jmeter.plugin.dubbo.sample.DubboSample\" "); + jmx = RegExUtils.replacePattern(jmx, "(PRE_PROCESSOR_ENV_false|PRE_PROCESSOR_ENV_true)", Translator.get("pre_processor_env")); + jmx = RegExUtils.replacePattern(jmx, "(POST_PROCESSOR_ENV_false|POST_PROCESSOR_ENV_true)", Translator.get("post_processor_env")); } return jmx; } diff --git a/api-test/backend/src/main/resources/i18n/messages_en_US.properties b/api-test/backend/src/main/resources/i18n/messages_en_US.properties index d731e6333f..3521fc3ed1 100644 --- a/api-test/backend/src/main/resources/i18n/messages_en_US.properties +++ b/api-test/backend/src/main/resources/i18n/messages_en_US.properties @@ -346,4 +346,6 @@ error_xml_struct=Data is not xml case_name_is_already_exist=Duplicate Case name file_format_does_not_meet_requirements=File format does not meet requirements url_is_not_valid=URL is not valid -scenario_step_parsing_error_check=Scenario step parsing error, check if plugin step is included! \ No newline at end of file +scenario_step_parsing_error_check=Scenario step parsing error, check if plugin step is included! +pre_processor_env=global prescript +post_processor_env=global postscript \ No newline at end of file diff --git a/api-test/backend/src/main/resources/i18n/messages_zh_CN.properties b/api-test/backend/src/main/resources/i18n/messages_zh_CN.properties index dd6d6b09f5..37981bd98c 100644 --- a/api-test/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/api-test/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -366,4 +366,5 @@ case_name_is_already_exist=用例名称不能重复 file_format_does_not_meet_requirements=文件格式不符合要求 url_is_not_valid=URL 格式不正确! scenario_step_parsing_error_check=场景步骤解析错误,请检查是否包含插件步骤! - +pre_processor_env=全局前置脚本 +post_processor_env=全局后置脚本 diff --git a/api-test/backend/src/main/resources/i18n/messages_zh_TW.properties b/api-test/backend/src/main/resources/i18n/messages_zh_TW.properties index c9dfd0798b..046e6f3ad0 100644 --- a/api-test/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/api-test/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -366,3 +366,5 @@ case_name_is_already_exist=用例名稱不能重復 file_format_does_not_meet_requirements=文件格式不符合要求 url_is_not_valid=URL 格式不正确! scenario_step_parsing_error_check=場景步驟解析錯誤,檢查是否包含插件步驟! +pre_processor_env=全局前置腳本 +post_processor_env=全局後置腳本