From b9be1ddd0e286183089776adb671b86bbd73e13f Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 11 Mar 2021 14:12:49 +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=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E7=B1=BB=E5=9E=8B,=20=E5=90=88?= =?UTF-8?q?=E5=B9=B6=20csv=20=E5=92=8C=20jar=20=E7=9A=84=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=20resour?= =?UTF-8?q?ceFiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/performance/engine/EngineFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java b/backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java index b16d44989e..bfc2d9461f 100644 --- a/backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java +++ b/backend/src/main/java/io/metersphere/performance/engine/EngineFactory.java @@ -19,7 +19,8 @@ import io.metersphere.service.FileService; import io.metersphere.service.KubernetesTestEngine; import io.metersphere.service.TestResourcePoolService; import org.apache.commons.beanutils.ConstructorUtils; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.reflections8.Reflections; import org.springframework.stereotype.Service; @@ -92,7 +93,7 @@ public class EngineFactory { } List jmxFiles = fileMetadataList.stream().filter(f -> StringUtils.equalsIgnoreCase(f.getType(), FileType.JMX.name())).collect(Collectors.toList()); - List resourceFiles = fileMetadataList.stream().filter(f -> !StringUtils.equalsIgnoreCase(f.getType(), FileType.JMX.name())).collect(Collectors.toList()); + List resourceFiles = ListUtils.subtract(fileMetadataList, jmxFiles); // 合并上传的jmx byte[] jmxBytes = mergeJmx(jmxFiles); final EngineContext engineContext = new EngineContext();