From 09df456c1dc8c21ea01bb87fc82d7e12e082b67c Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 23 May 2022 15:25:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9license=E6=A0=A1=E9=AA=8C=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8D=E4=BF=AE=E6=94=B9=E4=B9=8B=E5=90=8E=E7=9A=84=E9=81=97?= =?UTF-8?q?=E7=95=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parse/xml/reader/JmeterDocumentParser.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/JmeterDocumentParser.java index ea342bd32c..61b6063efe 100644 --- a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/JmeterDocumentParser.java @@ -557,7 +557,7 @@ public class JmeterDocumentParser implements EngineSourceParser { private void processBackendListener(Element backendListener) { String resourcePoolId = context.getResourcePoolId(); TestResourcePool resourcePool = CommonBeanFactory.getBean(TestResourcePoolService.class).getResourcePool(resourcePoolId); - if (checkLicense() && !BooleanUtils.toBoolean(resourcePool.getBackendListener())) { + if (!BooleanUtils.toBoolean(resourcePool.getBackendListener())) { return; } KafkaProperties kafkaProperties = CommonBeanFactory.getBean(KafkaProperties.class); @@ -617,7 +617,7 @@ public class JmeterDocumentParser implements EngineSourceParser { private void processCheckoutBackendListener(Element element) { String resourcePoolId = context.getResourcePoolId(); TestResourcePool resourcePool = CommonBeanFactory.getBean(TestResourcePoolService.class).getResourcePool(resourcePoolId); - if (checkLicense() && !BooleanUtils.toBoolean(resourcePool.getBackendListener())) { + if (!BooleanUtils.toBoolean(resourcePool.getBackendListener())) { return; } // 已经添加过不再重复添加 @@ -648,20 +648,6 @@ public class JmeterDocumentParser implements EngineSourceParser { context.setCheckBackendListener(true); } - private boolean checkLicense() { - try { - ClassUtils.getClass("io.metersphere.xpack.license.service.LicenseService"); - Object licenseService = CommonBeanFactory.getBean("licenseService"); - Object result = MethodUtils.invokeMethod(licenseService, "valid"); - Object status = MethodUtils.invokeMethod(result, "getStatus"); - if (StringUtils.equalsIgnoreCase("VALID", status.toString())) { - return true; - } - } catch (Exception ignored) { - } - return false; - } - private void processThreadGroup(Element threadGroup) { // 检查 threadgroup 后面的hashtree是否为空 Element hashTree = getNextSibling(threadGroup);