Merge branch 'v1.1' of https://github.com/metersphere/server into v1.1
This commit is contained in:
commit
c20e4c4e8c
|
@ -16,7 +16,6 @@ import org.apache.shiro.authz.annotation.RequiresRoles;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
|
|
|
@ -16,9 +16,8 @@ import org.apache.shiro.authz.annotation.RequiresRoles;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api")
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package io.metersphere.api.dto.parse.postman;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PostmanItem {
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
|||
@Data
|
||||
public class ExtractRegex extends ExtractCommon {
|
||||
private String useHeaders;
|
||||
|
||||
public ExtractRegex() {
|
||||
setType(ExtractType.REGEX);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package io.metersphere.api.jmeter;
|
||||
|
||||
import io.github.ningyu.jmeter.plugin.dubbo.sample.ProviderService;
|
||||
import io.metersphere.api.service.APIReportService;
|
||||
import io.metersphere.api.service.APITestService;
|
||||
import io.metersphere.commons.constants.APITestStatus;
|
||||
|
|
|
@ -10,11 +10,10 @@ import org.apache.jmeter.visualizers.backend.BackendListener;
|
|||
import org.apache.jorphan.collections.HashTree;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class JMeterService {
|
||||
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package io.metersphere.api.parse;
|
||||
|
||||
import io.metersphere.commons.constants.ApiImportPlatform;
|
||||
import io.metersphere.commons.constants.FileType;
|
||||
import io.metersphere.performance.parse.EngineSourceParser;
|
||||
import io.metersphere.performance.parse.xml.XmlEngineSourceParse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class ApiImportParserFactory {
|
||||
|
|
|
@ -7,8 +7,8 @@ import io.metersphere.api.dto.parse.ApiImport;
|
|||
import io.metersphere.api.dto.parse.postman.*;
|
||||
import io.metersphere.api.dto.scenario.Body;
|
||||
import io.metersphere.api.dto.scenario.KeyValue;
|
||||
import io.metersphere.api.dto.scenario.request.HttpRequest;
|
||||
import io.metersphere.api.dto.scenario.Scenario;
|
||||
import io.metersphere.api.dto.scenario.request.HttpRequest;
|
||||
import io.metersphere.api.dto.scenario.request.Request;
|
||||
import io.metersphere.commons.constants.MsRequestBodyType;
|
||||
import io.metersphere.commons.constants.PostmanRequestBodyMode;
|
||||
|
|
|
@ -6,8 +6,8 @@ import io.metersphere.api.dto.ApiTestImportRequest;
|
|||
import io.metersphere.api.dto.parse.ApiImport;
|
||||
import io.metersphere.api.dto.scenario.Body;
|
||||
import io.metersphere.api.dto.scenario.KeyValue;
|
||||
import io.metersphere.api.dto.scenario.request.HttpRequest;
|
||||
import io.metersphere.api.dto.scenario.Scenario;
|
||||
import io.metersphere.api.dto.scenario.request.HttpRequest;
|
||||
import io.metersphere.api.dto.scenario.request.Request;
|
||||
import io.metersphere.commons.constants.MsRequestBodyType;
|
||||
import io.metersphere.commons.constants.SwaggerParameterType;
|
||||
|
@ -64,7 +64,8 @@ public class Swagger2Parser extends ApiImportAbstractParser {
|
|||
Scenario scenario = Optional.ofNullable(scenarioMap.get(tag)).orElse(new Scenario());
|
||||
List<Request> requests = Optional.ofNullable(scenario.getRequests()).orElse(new ArrayList<>());
|
||||
requests.add(request);
|
||||
scenario.setRequests(requests);scenario.setName(tag);
|
||||
scenario.setRequests(requests);
|
||||
scenario.setName(tag);
|
||||
scenarioMap.put(tag, scenario);
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -12,19 +12,16 @@ import io.metersphere.base.mapper.ext.ExtApiTestReportMapper;
|
|||
import io.metersphere.commons.constants.APITestStatus;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.ServiceUtils;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.dto.DashboardTestDTO;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
|
|
|
@ -34,9 +34,7 @@ import org.springframework.util.CollectionUtils;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
|
@ -2,13 +2,23 @@ package io.metersphere.commons.exception;
|
|||
|
||||
public class MSException extends RuntimeException {
|
||||
|
||||
private MSException(String message) { super(message); }
|
||||
|
||||
private MSException(Throwable t) { super(t); }
|
||||
|
||||
public static void throwException(String message) { throw new MSException(message); }
|
||||
|
||||
public static MSException getException(String message) { throw new MSException(message); }
|
||||
|
||||
public static void throwException(Throwable t) { throw new MSException(t); }
|
||||
private MSException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
private MSException(Throwable t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public static void throwException(String message) {
|
||||
throw new MSException(message);
|
||||
}
|
||||
|
||||
public static MSException getException(String message) {
|
||||
throw new MSException(message);
|
||||
}
|
||||
|
||||
public static void throwException(Throwable t) {
|
||||
throw new MSException(t);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ public class MathUtils {
|
|||
/**
|
||||
* 获取百分比
|
||||
* 保留一位小数
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -7,9 +7,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
|||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
|
||||
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;
|
||||
|
||||
import javax.validation.Validator;
|
||||
|
||||
|
@ -31,6 +29,7 @@ public class I18nConfig {
|
|||
|
||||
/**
|
||||
* JSR-303校验国际化
|
||||
*
|
||||
* @param messageSource
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.fit2cloud.quartz.service.QuartzManageService;
|
|||
import com.fit2cloud.quartz.util.QuartzBeanFactory;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package io.metersphere.controller;
|
||||
|
||||
import io.metersphere.service.ScheduleService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import io.metersphere.commons.constants.ParamConstants;
|
|||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.ldap.domain.LdapInfo;
|
||||
import io.metersphere.service.SystemParameterService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -3,6 +3,7 @@ package io.metersphere.controller.request.member;
|
|||
import io.metersphere.base.domain.User;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -4,6 +4,7 @@ import io.metersphere.base.domain.Role;
|
|||
import io.metersphere.base.domain.UserRole;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
|
|
|
@ -11,7 +11,8 @@ public class ExcelErrData<T> {
|
|||
|
||||
private String errMsg;
|
||||
|
||||
public ExcelErrData(){}
|
||||
public ExcelErrData() {
|
||||
}
|
||||
|
||||
public ExcelErrData(T t, Integer rowNum, String errMsg) {
|
||||
this.t = t;
|
||||
|
|
|
@ -3,6 +3,7 @@ package io.metersphere.excel.domain;
|
|||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ExcelResponse<T> {
|
||||
|
||||
|
|
|
@ -11,7 +11,9 @@ import io.metersphere.excel.utils.EasyExcelI18nTranslator;
|
|||
import io.metersphere.excel.utils.ExcelValidateHelper;
|
||||
import io.metersphere.i18n.Translator;
|
||||
|
||||
import java.lang.reflect.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class EasyExcelListener<T> extends AnalysisEventListener<T> {
|
||||
|
@ -77,6 +79,7 @@ public abstract class EasyExcelListener <T> extends AnalysisEventListener<T> {
|
|||
/**
|
||||
* 可重写该方法
|
||||
* 自定义校验规则
|
||||
*
|
||||
* @param data
|
||||
* @param errMsg
|
||||
* @return
|
||||
|
@ -99,6 +102,7 @@ public abstract class EasyExcelListener <T> extends AnalysisEventListener<T> {
|
|||
|
||||
/**
|
||||
* 校验excel头部
|
||||
*
|
||||
* @param headMap 传入excel的头部(第一行数据)数据的index,name
|
||||
* @param context
|
||||
*/
|
||||
|
|
|
@ -1,24 +1,14 @@
|
|||
package io.metersphere.excel.utils;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
import io.metersphere.excel.domain.TestCaseExcelData;
|
||||
import io.metersphere.exception.ExcelException;
|
||||
import io.metersphere.i18n.Translator;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class EasyExcelExporter {
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package io.metersphere.excel.utils;
|
|||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
|
|
|
@ -14,6 +14,7 @@ public class ScheduleManager {
|
|||
|
||||
/**
|
||||
* 添加 simpleJob
|
||||
*
|
||||
* @param jobKey
|
||||
* @param triggerKey
|
||||
* @param cls
|
||||
|
@ -58,6 +59,7 @@ public class ScheduleManager {
|
|||
|
||||
/**
|
||||
* 添加 cronJob
|
||||
*
|
||||
* @param jobKey
|
||||
* @param triggerKey
|
||||
* @param jobClass
|
||||
|
@ -102,6 +104,7 @@ public class ScheduleManager {
|
|||
|
||||
/**
|
||||
* 修改 cronTrigger
|
||||
*
|
||||
* @param triggerKey
|
||||
* @param cron
|
||||
* @throws SchedulerException
|
||||
|
@ -149,6 +152,7 @@ public class ScheduleManager {
|
|||
|
||||
/**
|
||||
* 修改simpleTrigger触发器的触发时间
|
||||
*
|
||||
* @param triggerKey
|
||||
* @param repeatIntervalTime
|
||||
* @throws SchedulerException
|
||||
|
@ -199,12 +203,10 @@ public class ScheduleManager {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @Title:
|
||||
* @Description: 根据job和trigger删除任务
|
||||
*
|
||||
* @param jobKey
|
||||
* @param triggerKey
|
||||
* @Title:
|
||||
* @Description: 根据job和trigger删除任务
|
||||
*/
|
||||
public void removeJob(JobKey jobKey, TriggerKey triggerKey) {
|
||||
|
||||
|
@ -248,6 +250,7 @@ public class ScheduleManager {
|
|||
|
||||
/**
|
||||
* 新增或者修改 simpleJob
|
||||
*
|
||||
* @param jobKey
|
||||
* @param triggerKey
|
||||
* @param clz
|
||||
|
@ -273,6 +276,7 @@ public class ScheduleManager {
|
|||
|
||||
/**
|
||||
* 添加或修改 cronJob
|
||||
*
|
||||
* @param jobKey
|
||||
* @param triggerKey
|
||||
* @param jobClass
|
||||
|
|
|
@ -13,7 +13,10 @@ import io.metersphere.service.UserService;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.ldap.core.DirContextOperations;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
|
|
@ -55,7 +55,6 @@ public class LdapService {
|
|||
getMappingAttr("email", dirContextOperations);
|
||||
|
||||
|
||||
|
||||
return dirContextOperations;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,12 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class FileService {
|
||||
@Resource
|
||||
|
|
|
@ -5,6 +5,7 @@ import io.metersphere.base.mapper.RoleMapper;
|
|||
import io.metersphere.base.mapper.ext.ExtRoleMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.apache.commons.lang3.BooleanUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.mail.MessagingException;
|
||||
import java.util.*;
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.springframework.util.CollectionUtils;
|
|||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ public class TestCaseController {
|
|||
public void testCaseTemplateExport(HttpServletResponse response) {
|
||||
testCaseService.testCaseTemplateExport(response);
|
||||
}
|
||||
|
||||
@PostMapping("/export/testcase")
|
||||
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER}, logical = Logical.OR)
|
||||
public void testCaseExport(HttpServletResponse response, @RequestBody TestCaseBatchRequest request) {
|
||||
|
|
|
@ -24,6 +24,7 @@ public class TestCaseNodeController {
|
|||
public List<TestCaseNodeDTO> getNodeByProjectId(@PathVariable String projectId) {
|
||||
return testCaseNodeService.getNodeTreeByProjectId(projectId);
|
||||
}
|
||||
|
||||
/*模块列表列表*/
|
||||
@GetMapping("/list/all/plan/{planId}")
|
||||
public List<TestCaseNodeDTO> getAllNodeByPlanId(@PathVariable String planId) {
|
||||
|
|
|
@ -3,7 +3,6 @@ package io.metersphere.track.controller;
|
|||
import io.metersphere.base.domain.TestCaseReport;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.track.request.testCaseReport.CreateReportRequest;
|
||||
import io.metersphere.track.dto.TestCaseReportMetricDTO;
|
||||
import io.metersphere.track.service.TestCaseReportService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
|
|
|
@ -2,14 +2,13 @@ package io.metersphere.track.controller;
|
|||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.base.domain.TestPlanTestCase;
|
||||
import io.metersphere.base.domain.TestPlanTestCaseWithBLOBs;
|
||||
import io.metersphere.commons.constants.RoleConstants;
|
||||
import io.metersphere.commons.utils.PageUtils;
|
||||
import io.metersphere.commons.utils.Pager;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.service.TestPlanTestCaseService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
|
@ -17,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@RequestMapping("/test/plan/case")
|
||||
|
|
|
@ -7,9 +7,12 @@ import io.metersphere.track.dto.TestPlanDTO;
|
|||
public abstract class ReportComponent {
|
||||
protected String componentId;
|
||||
protected TestPlanDTO testPlan;
|
||||
|
||||
public ReportComponent(TestPlanDTO testPlan) {
|
||||
this.testPlan = testPlan;
|
||||
}
|
||||
|
||||
public abstract void readRecord(TestPlanCaseDTO testCase);
|
||||
|
||||
public abstract void afterBuild(TestCaseReportMetricDTO testCaseReportMetric);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.List;
|
|||
|
||||
public class ReportFailureResultComponent extends ReportComponent {
|
||||
private List<TestPlanCaseDTO> failureTestCases = new ArrayList<>();
|
||||
|
||||
public ReportFailureResultComponent(TestPlanDTO testPlan) {
|
||||
super(testPlan);
|
||||
componentId = "4";
|
||||
|
|
|
@ -95,7 +95,8 @@ public class ReportResultComponent extends ReportComponent {
|
|||
if (StringUtils.isNotBlank(testCase.getIssues())) {
|
||||
if (JSON.parseObject(testCase.getIssues()).getBoolean("hasIssues")) {
|
||||
moduleResult.setIssuesCount(moduleResult.getIssuesCount() + 1);
|
||||
};
|
||||
}
|
||||
;
|
||||
}
|
||||
moduleResultMap.put(rootNodeId, moduleResult);
|
||||
return;
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package io.metersphere.track.dto;
|
||||
|
||||
import io.metersphere.track.domain.ReportBaseInfoComponent;
|
||||
import io.metersphere.track.domain.ReportFailureResultComponent;
|
||||
import io.metersphere.track.domain.ReportResultChartComponent;
|
||||
import io.metersphere.track.domain.ReportResultComponent;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package io.metersphere.track.dto;
|
||||
|
||||
import io.metersphere.base.domain.TestPlan;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
|
|
@ -114,6 +114,7 @@ public class TestCaseNodeService {
|
|||
|
||||
/**
|
||||
* 递归构建节点树
|
||||
*
|
||||
* @param nodeLevelMap
|
||||
* @param rootNode
|
||||
* @return
|
||||
|
@ -175,6 +176,7 @@ public class TestCaseNodeService {
|
|||
/**
|
||||
* 获取当前计划下
|
||||
* 有关联数据的节点
|
||||
*
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
|
@ -219,10 +221,11 @@ public class TestCaseNodeService {
|
|||
|
||||
/**
|
||||
* 去除没有数据的节点
|
||||
*
|
||||
* @param rootNode
|
||||
* @param nodeIds
|
||||
* @return 是否剪枝
|
||||
* */
|
||||
*/
|
||||
public boolean pruningTree(TestCaseNodeDTO rootNode, List<String> nodeIds) {
|
||||
|
||||
List<TestCaseNodeDTO> children = rootNode.getChildren();
|
||||
|
@ -293,7 +296,8 @@ public class TestCaseNodeService {
|
|||
hasNode = true;
|
||||
createNodeByPathIterator(pathIterator, "/" + rootNodeName, nodeTree,
|
||||
pathMap, projectId, 2);
|
||||
};
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,6 +313,7 @@ public class TestCaseNodeService {
|
|||
|
||||
/**
|
||||
* 根据目标节点路径,创建相关节点
|
||||
*
|
||||
* @param pathIterator 遍历子路径
|
||||
* @param path 当前路径
|
||||
* @param treeNode 当前节点
|
||||
|
@ -336,7 +341,8 @@ public class TestCaseNodeService {
|
|||
hasNode = true;
|
||||
createNodeByPathIterator(pathIterator, path + "/" + child.getName(),
|
||||
child, pathMap, projectId, level + 1);
|
||||
};
|
||||
}
|
||||
;
|
||||
}
|
||||
|
||||
//若子节点中不包含该目标节点,则在该节点下创建
|
||||
|
@ -347,7 +353,6 @@ public class TestCaseNodeService {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pathIterator 迭代器,遍历子节点
|
||||
* @param nodeName 当前节点
|
||||
* @param pNode 父节点
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
package io.metersphere.track.service;
|
||||
|
||||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.mapper.*;
|
||||
import io.metersphere.base.mapper.ext.ExtTestCaseMapper;
|
||||
import io.metersphere.base.domain.TestCaseReport;
|
||||
import io.metersphere.base.domain.TestCaseReportExample;
|
||||
import io.metersphere.base.domain.TestCaseReportTemplate;
|
||||
import io.metersphere.base.domain.TestPlan;
|
||||
import io.metersphere.base.mapper.TestCaseReportMapper;
|
||||
import io.metersphere.base.mapper.TestCaseReportTemplateMapper;
|
||||
import io.metersphere.base.mapper.TestPlanMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
|
||||
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
|
||||
import io.metersphere.commons.utils.BeanUtils;
|
||||
import io.metersphere.track.request.testCaseReport.CreateReportRequest;
|
||||
import io.metersphere.track.request.testcase.QueryTestPlanRequest;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import io.metersphere.track.dto.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
|
|
@ -431,6 +431,7 @@ public class TestCaseService {
|
|||
|
||||
/**
|
||||
* 获取项目下一个num (页面展示的ID)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private int getNextNum(String projectId) {
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package io.metersphere.track.service;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.mapper.*;
|
||||
import io.metersphere.base.mapper.TestCaseMapper;
|
||||
import io.metersphere.base.mapper.TestCaseReportMapper;
|
||||
import io.metersphere.base.mapper.TestPlanMapper;
|
||||
import io.metersphere.base.mapper.TestPlanTestCaseMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtProjectMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
|
||||
|
@ -16,15 +18,15 @@ import io.metersphere.commons.user.SessionUser;
|
|||
import io.metersphere.commons.utils.MathUtils;
|
||||
import io.metersphere.commons.utils.ServiceUtils;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.controller.request.ProjectRequest;
|
||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||
import io.metersphere.dto.ProjectDTO;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.track.Factory.ReportComponentFactory;
|
||||
import io.metersphere.track.domain.ReportComponent;
|
||||
import io.metersphere.track.dto.*;
|
||||
import io.metersphere.track.dto.TestCaseReportMetricDTO;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.dto.TestPlanDTO;
|
||||
import io.metersphere.track.dto.TestPlanDTOWithMetric;
|
||||
import io.metersphere.track.request.testcase.PlanCaseRelevanceRequest;
|
||||
import io.metersphere.track.request.testcase.QueryTestPlanRequest;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
|
@ -35,10 +37,8 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
@ -75,7 +75,8 @@ public class TestPlanService {
|
|||
public void addTestPlan(TestPlan testPlan) {
|
||||
if (getTestPlanByName(testPlan.getName()).size() > 0) {
|
||||
MSException.throwException(Translator.get("plan_name_already_exists"));
|
||||
};
|
||||
}
|
||||
;
|
||||
testPlan.setId(UUID.randomUUID().toString());
|
||||
testPlan.setStatus(TestPlanStatus.Prepare.name());
|
||||
testPlan.setCreateTime(System.currentTimeMillis());
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package io.metersphere.track.service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.base.domain.*;
|
||||
import io.metersphere.base.domain.TestPlan;
|
||||
import io.metersphere.base.domain.TestPlanTestCaseExample;
|
||||
import io.metersphere.base.domain.TestPlanTestCaseWithBLOBs;
|
||||
import io.metersphere.base.domain.User;
|
||||
import io.metersphere.base.mapper.TestPlanTestCaseMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
|
||||
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
|
||||
|
@ -9,11 +12,9 @@ import io.metersphere.commons.user.SessionUser;
|
|||
import io.metersphere.commons.utils.BeanUtils;
|
||||
import io.metersphere.commons.utils.ServiceUtils;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.controller.request.OrderRequest;
|
||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||
import io.metersphere.service.UserService;
|
||||
import io.metersphere.track.dto.TestPlanCaseDTO;
|
||||
import io.metersphere.track.dto.TestPlanDTO;
|
||||
import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest;
|
||||
import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
Loading…
Reference in New Issue