Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
6eaec2972a
|
@ -5,6 +5,6 @@ import io.metersphere.dto.LicenseDTO;
|
||||||
public interface LicenseService {
|
public interface LicenseService {
|
||||||
|
|
||||||
public LicenseDTO valid();
|
public LicenseDTO valid();
|
||||||
|
|
||||||
public LicenseDTO addValidLicense(String reqLicenseCode);
|
public LicenseDTO addValidLicense(String reqLicenseCode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,6 +226,7 @@ public class TestCaseReviewService {
|
||||||
public void deleteCaseReview(String reviewId) {
|
public void deleteCaseReview(String reviewId) {
|
||||||
deleteCaseReviewProject(reviewId);
|
deleteCaseReviewProject(reviewId);
|
||||||
deleteCaseReviewUsers(reviewId);
|
deleteCaseReviewUsers(reviewId);
|
||||||
|
deleteCaseReviewTestCase(reviewId);
|
||||||
testCaseReviewMapper.deleteByPrimaryKey(reviewId);
|
testCaseReviewMapper.deleteByPrimaryKey(reviewId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,6 +242,12 @@ public class TestCaseReviewService {
|
||||||
testCaseReviewUsersMapper.deleteByExample(testCaseReviewUsersExample);
|
testCaseReviewUsersMapper.deleteByExample(testCaseReviewUsersExample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteCaseReviewTestCase(String reviewId) {
|
||||||
|
TestCaseReviewTestCaseExample testCaseReviewTestCaseExample = new TestCaseReviewTestCaseExample();
|
||||||
|
testCaseReviewTestCaseExample.createCriteria().andReviewIdEqualTo(reviewId);
|
||||||
|
testCaseReviewTestCaseMapper.deleteByExample(testCaseReviewTestCaseExample);
|
||||||
|
}
|
||||||
|
|
||||||
public List<TestCaseReview> listCaseReviewAll(String currentWorkspaceId) {
|
public List<TestCaseReview> listCaseReviewAll(String currentWorkspaceId) {
|
||||||
ProjectExample projectExample = new ProjectExample();
|
ProjectExample projectExample = new ProjectExample();
|
||||||
projectExample.createCriteria().andWorkspaceIdEqualTo(currentWorkspaceId);
|
projectExample.createCriteria().andWorkspaceIdEqualTo(currentWorkspaceId);
|
||||||
|
@ -384,7 +391,7 @@ public class TestCaseReviewService {
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestReviewCaseDTO> listTestCaseByProjectIds(List<String> projectIds) {
|
public List<TestReviewCaseDTO> listTestCaseByProjectIds(List<String> projectIds) {
|
||||||
QueryCaseReviewRequest request = new QueryCaseReviewRequest();
|
QueryCaseReviewRequest request = new QueryCaseReviewRequest();
|
||||||
request.setProjectIds(projectIds);
|
request.setProjectIds(projectIds);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import io.metersphere.track.service.TestCaseService;
|
||||||
import io.metersphere.xmind.parser.XmindParser;
|
import io.metersphere.xmind.parser.XmindParser;
|
||||||
import io.metersphere.xmind.parser.pojo.Attached;
|
import io.metersphere.xmind.parser.pojo.Attached;
|
||||||
import io.metersphere.xmind.parser.pojo.JsonRootBean;
|
import io.metersphere.xmind.parser.pojo.JsonRootBean;
|
||||||
import org.springframework.util.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -21,7 +21,7 @@ import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据转换
|
* 数据转换
|
||||||
* 1 解析Xmind文件 XmindParser.parseJson
|
* 1 解析Xmind文件 XmindParser.parseObject
|
||||||
* 2 解析后的JSON this.parse 转成测试用例
|
* 2 解析后的JSON this.parse 转成测试用例
|
||||||
*/
|
*/
|
||||||
public class XmindCaseParser {
|
public class XmindCaseParser {
|
||||||
|
@ -33,10 +33,10 @@ public class XmindCaseParser {
|
||||||
// 已存在用例名称
|
// 已存在用例名称
|
||||||
private Set<String> testCaseNames;
|
private Set<String> testCaseNames;
|
||||||
|
|
||||||
// 案例详情重写了hashCode方法去重用
|
// 转换后的案例信息
|
||||||
private List<TestCaseWithBLOBs> testCases;
|
private List<TestCaseWithBLOBs> testCases;
|
||||||
|
|
||||||
// 用于重复对比
|
// 案例详情重写了hashCode方法去重用
|
||||||
private List<TestCaseExcelData> compartDatas;
|
private List<TestCaseExcelData> compartDatas;
|
||||||
|
|
||||||
public XmindCaseParser(TestCaseService testCaseService, String userId, String projectId, Set<String> testCaseNames) {
|
public XmindCaseParser(TestCaseService testCaseService, String userId, String projectId, Set<String> testCaseNames) {
|
||||||
|
@ -194,21 +194,21 @@ public class XmindCaseParser {
|
||||||
String nodePath = data.getNodePath();
|
String nodePath = data.getNodePath();
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
|
||||||
if (nodePath != null) {
|
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) {
|
||||||
stringBuilder.append(Translator.get("test_case_node_level_tip") +
|
stringBuilder.append(Translator.get("test_case_node_level_tip") +
|
||||||
TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level") + "; ");
|
TestCaseConstants.MAX_NODE_DEPTH + Translator.get("test_case_node_level") + "; ");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < nodes.length; i++) {
|
for (int i = 0; i < nodes.length; i++) {
|
||||||
if (i != 0 && org.apache.commons.lang3.StringUtils.equals(nodes[i].trim(), "")) {
|
if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
|
||||||
stringBuilder.append(Translator.get("module_not_null") + "; ");
|
stringBuilder.append(Translator.get("module_not_null") + "; ");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (org.apache.commons.lang3.StringUtils.equals(data.getType(), TestCaseConstants.Type.Functional.getValue()) && org.apache.commons.lang3.StringUtils.equals(data.getMethod(), TestCaseConstants.Method.Auto.getValue())) {
|
if (StringUtils.equals(data.getType(), TestCaseConstants.Type.Functional.getValue()) && StringUtils.equals(data.getMethod(), TestCaseConstants.Method.Auto.getValue())) {
|
||||||
stringBuilder.append(Translator.get("functional_method_tip") + "; ");
|
stringBuilder.append(Translator.get("functional_method_tip") + "; ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue