refactor(测试跟踪): 统一导入校验的过程变量
This commit is contained in:
parent
01f5dd02a1
commit
021e6b51fa
|
@ -90,7 +90,7 @@ public class XmindCaseParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 递归处理案例数据
|
// 递归处理案例数据
|
||||||
private void recursion(StringBuffer processBuffer, Attached parent, int level, List<Attached> attacheds) {
|
private void recursion(Attached parent, int level, List<Attached> attacheds) {
|
||||||
for (Attached item : attacheds) {
|
for (Attached item : attacheds) {
|
||||||
if (isAvailable(item.getTitle(), "(?:tc:|tc:|tc)")) { // 用例
|
if (isAvailable(item.getTitle(), "(?:tc:|tc:|tc)")) { // 用例
|
||||||
item.setParent(parent);
|
item.setParent(parent);
|
||||||
|
@ -100,7 +100,7 @@ public class XmindCaseParser {
|
||||||
item.setPath(nodePath);
|
item.setPath(nodePath);
|
||||||
item.setParent(parent);
|
item.setParent(parent);
|
||||||
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
||||||
recursion(processBuffer, item, level + 1, item.getChildren().getAttached());
|
recursion(item, level + 1, item.getChildren().getAttached());
|
||||||
} else {
|
} else {
|
||||||
if (!nodePath.startsWith("/")) {
|
if (!nodePath.startsWith("/")) {
|
||||||
nodePath = "/" + nodePath;
|
nodePath = "/" + nodePath;
|
||||||
|
@ -267,7 +267,6 @@ public class XmindCaseParser {
|
||||||
|
|
||||||
// 导入思维导图处理
|
// 导入思维导图处理
|
||||||
public String parse(MultipartFile multipartFile) {
|
public String parse(MultipartFile multipartFile) {
|
||||||
StringBuffer processBuffer = new StringBuffer();
|
|
||||||
try {
|
try {
|
||||||
// 获取思维导图内容
|
// 获取思维导图内容
|
||||||
List<JsonRootBean> roots = XmindParser.parseObject(multipartFile);
|
List<JsonRootBean> roots = XmindParser.parseObject(multipartFile);
|
||||||
|
@ -281,7 +280,7 @@ public class XmindCaseParser {
|
||||||
String nodePath = item.getTitle();
|
String nodePath = item.getTitle();
|
||||||
item.setPath(nodePath);
|
item.setPath(nodePath);
|
||||||
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
||||||
recursion(processBuffer, item, 1, item.getChildren().getAttached());
|
recursion(item, 1, item.getChildren().getAttached());
|
||||||
} else {
|
} else {
|
||||||
if (!nodePath.startsWith("/")) {
|
if (!nodePath.startsWith("/")) {
|
||||||
nodePath = "/" + nodePath;
|
nodePath = "/" + nodePath;
|
||||||
|
@ -295,7 +294,8 @@ public class XmindCaseParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.validate();
|
|
||||||
|
this.validate(); //检查目录合规性
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return ex.getMessage();
|
return ex.getMessage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue