fix(接口测试): 导入用例名称长度保护

This commit is contained in:
fit2-zhao 2020-10-14 11:44:12 +08:00
parent b2f80fea78
commit a02cb2cc46
1 changed files with 5 additions and 1 deletions

View File

@ -248,6 +248,10 @@ public class XmindCaseParser {
String nodePath = data.getNodePath(); String nodePath = data.getNodePath();
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
if (data.getName().length() > 50) {
stringBuilder.append(data.getName() + "" + Translator.get("test_case") + Translator.get("test_track.length_less_than") + "50 ;");
}
if (!StringUtils.isEmpty(nodePath)) { if (!StringUtils.isEmpty(nodePath)) {
String[] nodes = nodePath.split("/"); String[] nodes = nodePath.split("/");
if (nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) { if (nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) {
@ -259,7 +263,7 @@ public class XmindCaseParser {
stringBuilder.append(Translator.get("module_not_null") + "; "); stringBuilder.append(Translator.get("module_not_null") + "; ");
break; break;
} else if (nodes[i].trim().length() > 30) { } else if (nodes[i].trim().length() > 30) {
stringBuilder.append(nodes[i].trim() + "" + Translator.get("test_track.length_less_than") + "30 ;"); stringBuilder.append(nodes[i].trim() + "" + Translator.get("module") + Translator.get("test_track.length_less_than") + "30 ;");
break; break;
} }
} }