fix 导入用例模块为空报错
This commit is contained in:
parent
1fc354e556
commit
457ee06b87
|
@ -39,18 +39,19 @@ public class TestCaseDataListener extends EasyExcelListener<TestCaseExcelData> {
|
|||
public String validate(TestCaseExcelData data, String errMsg) {
|
||||
String nodePath = data.getNodePath();
|
||||
StringBuilder stringBuilder = new StringBuilder(errMsg);
|
||||
String[] nodes = nodePath.split("/");
|
||||
|
||||
if (nodePath != null) {
|
||||
String[] nodes = nodePath.split("/");
|
||||
if ( nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) {
|
||||
stringBuilder.append("节点最多为" + TestCaseConstants.MAX_NODE_DEPTH + "层;");
|
||||
}
|
||||
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
|
||||
stringBuilder.append("所属模块不能为空格");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!userIds.contains(data.getMaintainer())) {
|
||||
stringBuilder.append("该工作空间下无该用户:" + data.getMaintainer() + ";");
|
||||
|
|
Loading…
Reference in New Issue