From 6336d33330bc7058864deae0e1c53c312e3e17a0 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 9 Oct 2020 15:37:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=94=AF=E6=8C=81Dubbo=E5=8D=8F=E8=AE=AE=E5=92=8Csql=20?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/jmeter/JMeterVars.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java b/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java index 91dfb1edac..7d7569520e 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java @@ -1,10 +1,12 @@ package io.metersphere.api.jmeter; +import io.github.ningyu.jmeter.plugin.dubbo.sample.DubboSample; import org.apache.jmeter.extractor.JSR223PostProcessor; import org.apache.jmeter.extractor.RegexExtractor; import org.apache.jmeter.extractor.XPath2Extractor; import org.apache.jmeter.extractor.json.jsonpath.JSONPostProcessor; import org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy; +import org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler; import org.apache.jmeter.threads.JMeterVariables; import org.apache.jorphan.collections.HashTree; import org.springframework.util.StringUtils; @@ -22,6 +24,7 @@ public class JMeterVars { // 线程执行过程调用提取变量值 public static void addVars(Integer testId, JMeterVariables vars, String extract) { JMeterVariables vs = new JMeterVariables(); + if (!StringUtils.isEmpty(extract) && vars != null) { List extracts = Arrays.asList(extract.split(";")); Optional.ofNullable(extracts).orElse(new ArrayList<>()).forEach(item -> { @@ -29,14 +32,15 @@ public class JMeterVars { }); vs.remove("TESTSTART.MS"); // 标示变量移除 } + variables.put(testId, vs); } - // 递归处理所有请求,对有提取变量的增加后置脚本 + // 处理所有请求,有提取变量的请求增加后置脚本提取变量值 public static void addJSR223PostProcessor(HashTree tree) { for (Object key : tree.keySet()) { HashTree node = tree.get(key); - if (key instanceof HTTPSamplerProxy) { + if (key instanceof HTTPSamplerProxy || key instanceof DubboSample || key instanceof JDBCSampler) { StringJoiner extract = new StringJoiner(";"); for (Object child : node.keySet()) { if (child instanceof RegexExtractor) { @@ -50,6 +54,7 @@ public class JMeterVars { extract.add(regexExtractor.getRefNames()); } } + if (Optional.ofNullable(extract).orElse(extract).length() > 0) { JSR223PostProcessor shell = new JSR223PostProcessor(); shell.setEnabled(true); @@ -57,6 +62,7 @@ public class JMeterVars { node.add(shell); } } + if (node != null) { addJSR223PostProcessor(node); } From 04a022a4f320a61f991ce3a6b5ddc301536c262b Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 9 Oct 2020 16:13:49 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2=E5=B7=A6=E4=B8=8A=E8=A7=92=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=A4=B4=E5=83=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/settings/CurrentUser.vue | 99 +++++++++++-------- 1 file changed, 56 insertions(+), 43 deletions(-) diff --git a/frontend/src/business/components/settings/CurrentUser.vue b/frontend/src/business/components/settings/CurrentUser.vue index 9b62a8d600..3ad85ee1af 100644 --- a/frontend/src/business/components/settings/CurrentUser.vue +++ b/frontend/src/business/components/settings/CurrentUser.vue @@ -1,60 +1,73 @@ From 446f0cdcde7315e0ca1a2ae5db5a32810a0a0bd4 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 9 Oct 2020 16:27:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E2=80=9C=E8=B4=9F=E8=B4=A3=E4=BA=BA=E2=80=9D=E5=BA=94=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=88=90=E5=91=98=E5=A7=93=E5=90=8D=EF=BC=8C=E9=9D=9E?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=88=90=E5=91=98ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes 406 --- .../io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml | 6 ++++-- .../src/main/java/io/metersphere/track/dto/TestPlanDTO.java | 1 + .../components/track/plan/components/TestPlanList.vue | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml index 2b2a4a80c1..306ce1e2c0 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml @@ -4,7 +4,8 @@ - + + @@ -97,7 +98,8 @@