From d62c155df622abe1c33c865a20dc5289b5e181ff Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 7 May 2021 15:17:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E8=AE=BE=E7=BD=AE=E5=85=B1=E4=BA=AB=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E8=A7=A3=E5=86=B3=20=E5=BE=AA=E7=8E=AF=20csv=20?= =?UTF-8?q?=E4=BB=8E=E7=AC=AC=E4=BA=8C=E8=A1=8C=E5=8F=96=E5=80=BC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/dto/definition/request/MsScenario.java | 2 +- .../api/dto/definition/request/MsTestElement.java | 5 ++--- .../dto/definition/request/controller/MsLoopController.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index 1b86391bfd..2d7ace1cf5 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -156,7 +156,7 @@ public class MsScenario extends MsTestElement { if (arguments != null) { tree.add(ParameterConfig.valueSupposeMock(arguments)); } - this.addCsvDataSet(tree, variables,config); + this.addCsvDataSet(tree, variables, config, "shareMode.group"); this.addCounter(tree, variables); this.addRandom(tree, variables); if (CollectionUtils.isNotEmpty(this.headers)) { diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java index 4b8c83b4ae..00d2067926 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsTestElement.java @@ -188,7 +188,7 @@ public abstract class MsTestElement { return null; } - protected void addCsvDataSet(HashTree tree, List variables, ParameterConfig config) { + protected void addCsvDataSet(HashTree tree, List variables, ParameterConfig config, String shareMode) { if (CollectionUtils.isNotEmpty(variables)) { List list = variables.stream().filter(ScenarioVariable::isCSVValid).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(list)) { @@ -206,8 +206,7 @@ public abstract class MsTestElement { csvDataSet.setProperty("filename", BODY_FILE_DIR + "/" + item.getFiles().get(0).getId() + "_" + item.getFiles().get(0).getName()); } csvDataSet.setIgnoreFirstLine(false); - // csvDataSet.setProperty("quotedData",true); - csvDataSet.setProperty("shareMode", "shareMode.group"); + csvDataSet.setProperty("shareMode", shareMode); csvDataSet.setProperty("recycle", true); csvDataSet.setProperty("delimiter", item.getDelimiter()); csvDataSet.setComment(StringUtils.isEmpty(item.getDescription()) ? "" : item.getDescription()); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java index 195611ac0f..5864f2fa43 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java @@ -56,7 +56,7 @@ public class MsLoopController extends MsTestElement { } final HashTree groupTree = controller(tree); if (CollectionUtils.isNotEmpty(config.getVariables())) { - this.addCsvDataSet(groupTree, config.getVariables(), config); + this.addCsvDataSet(groupTree, config.getVariables(), config, "shareMode.thread"); this.addCounter(groupTree, config.getVariables()); this.addRandom(groupTree, config.getVariables()); }