From 5bff7a4e5f208737824817705c7f5fc81cb344b5 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 18 Jun 2021 12:20:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=87=BA=E7=8E=B0=E9=85=8D=E7=BD=AE=E9=94=99?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xml/reader/jmx/JmeterDocumentParser.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java index 6d4d8cb510..c7f7165638 100644 --- a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java @@ -742,6 +742,23 @@ public class JmeterDocumentParser implements DocumentParser { */ removeChildren(threadGroup); + // 避免出现配置错位 + Object iterateNum = context.getProperty("iterateNum"); + if (iterateNum instanceof List) { + ((List) iterateNum).remove(0); + } + Object iterateRampUpTimes = context.getProperty("iterateRampUpTime"); + if (iterateRampUpTimes instanceof List) { + ((List) iterateRampUpTimes).remove(0); + } + Object steps = context.getProperty("Steps"); + if (steps instanceof List) { + ((List) steps).remove(0); + } + Object holds = context.getProperty("Hold"); + if (holds instanceof List) { + ((List) holds).remove(0); + } Object targetLevels = context.getProperty("TargetLevel"); String threads = "10"; if (targetLevels instanceof List) { @@ -838,6 +855,19 @@ public class JmeterDocumentParser implements DocumentParser { S */ removeChildren(threadGroup); + // 避免出现配置错位 + Object iterateNum = context.getProperty("iterateNum"); + if (iterateNum instanceof List) { + ((List) iterateNum).remove(0); + } + Object iterateRampUpTimes = context.getProperty("iterateRampUpTime"); + if (iterateRampUpTimes instanceof List) { + ((List) iterateRampUpTimes).remove(0); + } + Object durations = context.getProperty("duration"); + if (durations instanceof List) { + ((List) durations).remove(0); + } // elementProp Object targetLevels = context.getProperty("TargetLevel"); String threads = "10"; @@ -970,6 +1000,27 @@ public class JmeterDocumentParser implements DocumentParser { true */ // elementProp + // 避免出现配置错位 + Object durations = context.getProperty("duration"); + if (durations instanceof List) { + ((List) durations).remove(0); + } + Object units = context.getProperty("unit"); + if (units instanceof List) { + ((List) units).remove(0); + } + Object holds = context.getProperty("Hold"); + if (holds instanceof List) { + ((List) holds).remove(0); + } + Object steps = context.getProperty("Steps"); + if (steps instanceof List) { + ((List) steps).remove(0); + } + Object arampUps = context.getProperty("RampUp"); + if (arampUps instanceof List) { + ((List) arampUps).remove(0); + } Object targetLevels = context.getProperty("TargetLevel"); String threads = "10"; if (targetLevels instanceof List) {