refactor(测试跟踪): 合并导入所有校验方法
This commit is contained in:
parent
cb8fb36297
commit
e4a7c2eb34
|
@ -82,7 +82,8 @@ public class XmindCaseParser {
|
|||
for (int i = 0; i < nodes.length; i++) {
|
||||
if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
|
||||
process.append(Translator.get("module_not_null") + "; ");
|
||||
break;
|
||||
} else if (nodes[i].trim().length() > 30) {
|
||||
process.append(nodes[i].trim() + ":" + Translator.get("test_track.length_less_than") + "30 ;");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -95,7 +96,6 @@ public class XmindCaseParser {
|
|||
item.setParent(parent);
|
||||
this.newTestCase(item.getTitle(), parent.getPath(), item.getChildren() != null ? item.getChildren().getAttached() : null);
|
||||
} else {
|
||||
validLength(item.getTitle());
|
||||
String nodePath = parent.getPath() + "/" + item.getTitle();
|
||||
item.setPath(nodePath);
|
||||
item.setParent(parent);
|
||||
|
@ -222,13 +222,6 @@ public class XmindCaseParser {
|
|||
compartDatas.add(compartData);
|
||||
}
|
||||
|
||||
private void validLength(String title) {
|
||||
if (StringUtils.equals(title.trim(), ""))
|
||||
process.append(Translator.get("module_not_null") + "; ");
|
||||
if (title.length() > 30)
|
||||
process.append(title + ":" + Translator.get("test_track.length_less_than") + "30 ;");
|
||||
}
|
||||
|
||||
// 验证合法性
|
||||
private boolean validate(TestCaseWithBLOBs data) {
|
||||
String nodePath = data.getNodePath();
|
||||
|
@ -244,6 +237,9 @@ public class XmindCaseParser {
|
|||
if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
|
||||
stringBuilder.append(Translator.get("module_not_null") + "; ");
|
||||
break;
|
||||
} else if (nodes[i].trim().length() > 30) {
|
||||
stringBuilder.append(nodes[i].trim() + ":" + Translator.get("test_track.length_less_than") + "30 ;");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -281,7 +277,6 @@ public class XmindCaseParser {
|
|||
if (isAvailable(item.getTitle(), "(?:tc:|tc:|tc)")) { // 用例
|
||||
return replace(item.getTitle(), "(?:tc:|tc:|tc)") + ":" + Translator.get("test_case_create_module_fail");
|
||||
} else {
|
||||
validLength(item.getTitle());
|
||||
item.setPath(item.getTitle());
|
||||
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
|
||||
recursion(processBuffer, item, 1, item.getChildren().getAttached());
|
||||
|
|
Loading…
Reference in New Issue