From 160025c92bf45bf1c8677779f1a88fae274c70d7 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 28 Mar 2023 16:56:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E5=8E=8B=E5=8A=9B=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1024918 --user=刘瑞斌 【性能测试】执行性能测试空指针错误 https://www.tapd.cn/55049933/s/1356639 --- .../src/main/java/io/metersphere/engine/EngineFactory.java | 3 +++ .../backend/src/main/resources/i18n/messages.properties | 1 + .../backend/src/main/resources/i18n/messages_en_US.properties | 1 + .../backend/src/main/resources/i18n/messages_zh_CN.properties | 1 + .../backend/src/main/resources/i18n/messages_zh_TW.properties | 1 + 5 files changed, 7 insertions(+) create mode 100644 performance-test/backend/src/main/resources/i18n/messages.properties create mode 100644 performance-test/backend/src/main/resources/i18n/messages_en_US.properties create mode 100644 performance-test/backend/src/main/resources/i18n/messages_zh_CN.properties create mode 100644 performance-test/backend/src/main/resources/i18n/messages_zh_TW.properties diff --git a/performance-test/backend/src/main/java/io/metersphere/engine/EngineFactory.java b/performance-test/backend/src/main/java/io/metersphere/engine/EngineFactory.java index 78bf0ad26b..d05cadc377 100644 --- a/performance-test/backend/src/main/java/io/metersphere/engine/EngineFactory.java +++ b/performance-test/backend/src/main/java/io/metersphere/engine/EngineFactory.java @@ -120,6 +120,9 @@ public class EngineFactory { } if (values instanceof List) { Object value = b.get("value"); + if (value == null) { + MSException.throwException(Translator.get("load_configuration_value_is_null") + ", key:" + key); + } if ("TargetLevel".equals(key)) { switch (strategy) { default: diff --git a/performance-test/backend/src/main/resources/i18n/messages.properties b/performance-test/backend/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000000..e0bc3287b4 --- /dev/null +++ b/performance-test/backend/src/main/resources/i18n/messages.properties @@ -0,0 +1 @@ +load_configuration_value_is_null= \ No newline at end of file diff --git a/performance-test/backend/src/main/resources/i18n/messages_en_US.properties b/performance-test/backend/src/main/resources/i18n/messages_en_US.properties new file mode 100644 index 0000000000..ab9ca24131 --- /dev/null +++ b/performance-test/backend/src/main/resources/i18n/messages_en_US.properties @@ -0,0 +1 @@ +load_configuration_value_is_null=Load configuration error \ No newline at end of file diff --git a/performance-test/backend/src/main/resources/i18n/messages_zh_CN.properties b/performance-test/backend/src/main/resources/i18n/messages_zh_CN.properties new file mode 100644 index 0000000000..1b5b5ab0eb --- /dev/null +++ b/performance-test/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -0,0 +1 @@ +load_configuration_value_is_null=压力配置参数错误 \ No newline at end of file diff --git a/performance-test/backend/src/main/resources/i18n/messages_zh_TW.properties b/performance-test/backend/src/main/resources/i18n/messages_zh_TW.properties new file mode 100644 index 0000000000..fb8339d233 --- /dev/null +++ b/performance-test/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -0,0 +1 @@ +load_configuration_value_is_null=壓力配置參數錯誤 \ No newline at end of file