fix: 去掉用例导入前置条件等长度限制

This commit is contained in:
chenjianxing 2021-04-27 17:43:51 +08:00 committed by jianxing
parent 406e51560a
commit 7db7201195
10 changed files with 38 additions and 122 deletions

View File

@ -23,8 +23,6 @@ public class TestCase implements Serializable {
private String method;
private String prerequisite;
private Long createTime;
private Long updateTime;
@ -52,6 +50,6 @@ public class TestCase implements Serializable {
private String customNum;
private String stepModel;
private static final long serialVersionUID = 1L;
}

View File

@ -734,76 +734,6 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andPrerequisiteIsNull() {
addCriterion("prerequisite is null");
return (Criteria) this;
}
public Criteria andPrerequisiteIsNotNull() {
addCriterion("prerequisite is not null");
return (Criteria) this;
}
public Criteria andPrerequisiteEqualTo(String value) {
addCriterion("prerequisite =", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteNotEqualTo(String value) {
addCriterion("prerequisite <>", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteGreaterThan(String value) {
addCriterion("prerequisite >", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteGreaterThanOrEqualTo(String value) {
addCriterion("prerequisite >=", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteLessThan(String value) {
addCriterion("prerequisite <", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteLessThanOrEqualTo(String value) {
addCriterion("prerequisite <=", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteLike(String value) {
addCriterion("prerequisite like", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteNotLike(String value) {
addCriterion("prerequisite not like", value, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteIn(List<String> values) {
addCriterion("prerequisite in", values, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteNotIn(List<String> values) {
addCriterion("prerequisite not in", values, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteBetween(String value1, String value2) {
addCriterion("prerequisite between", value1, value2, "prerequisite");
return (Criteria) this;
}
public Criteria andPrerequisiteNotBetween(String value1, String value2) {
addCriterion("prerequisite not between", value1, value2, "prerequisite");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
@ -1743,7 +1673,6 @@ public class TestCaseExample {
addCriterion("step_model not between", value1, value2, "stepModel");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -9,6 +9,8 @@ import lombok.ToString;
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TestCaseWithBLOBs extends TestCase implements Serializable {
private String prerequisite;
private String remark;
private String steps;

View File

@ -11,7 +11,6 @@
<result column="maintainer" jdbcType="VARCHAR" property="maintainer" />
<result column="priority" jdbcType="VARCHAR" property="priority" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="prerequisite" jdbcType="VARCHAR" property="prerequisite" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="test_id" jdbcType="VARCHAR" property="testId" />
@ -28,6 +27,7 @@
<result column="step_model" jdbcType="VARCHAR" property="stepModel" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseWithBLOBs">
<result column="prerequisite" jdbcType="LONGVARCHAR" property="prerequisite" />
<result column="remark" jdbcType="LONGVARCHAR" property="remark" />
<result column="steps" jdbcType="LONGVARCHAR" property="steps" />
<result column="step_description" jdbcType="LONGVARCHAR" property="stepDescription" />
@ -94,11 +94,11 @@
</sql>
<sql id="Base_Column_List">
id, node_id, node_path, project_id, `name`, `type`, maintainer, priority, `method`,
prerequisite, create_time, update_time, test_id, sort, num, other_test_name, review_status,
tags, demand_id, demand_name, follow_people, `status`, custom_num, step_model
create_time, update_time, test_id, sort, num, other_test_name, review_status, tags,
demand_id, demand_name, follow_people, `status`, custom_num, step_model
</sql>
<sql id="Blob_Column_List">
remark, steps, step_description, expected_result, custom_fields
prerequisite, remark, steps, step_description, expected_result, custom_fields
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseExample" resultMap="ResultMapWithBLOBs">
select
@ -152,21 +152,21 @@
insert into test_case (id, node_id, node_path,
project_id, `name`, `type`,
maintainer, priority, `method`,
prerequisite, create_time, update_time,
test_id, sort, num,
other_test_name, review_status, tags,
demand_id, demand_name, follow_people,
`status`, custom_num, step_model,
create_time, update_time, test_id,
sort, num, other_test_name,
review_status, tags, demand_id,
demand_name, follow_people, `status`,
custom_num, step_model, prerequisite,
remark, steps, step_description,
expected_result, custom_fields)
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{nodePath,jdbcType=VARCHAR},
#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR},
#{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{testId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{num,jdbcType=INTEGER},
#{otherTestName,jdbcType=VARCHAR}, #{reviewStatus,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR},
#{demandId,jdbcType=VARCHAR}, #{demandName,jdbcType=VARCHAR}, #{followPeople,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{customNum,jdbcType=VARCHAR}, #{stepModel,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{testId,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{num,jdbcType=INTEGER}, #{otherTestName,jdbcType=VARCHAR},
#{reviewStatus,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR}, #{demandId,jdbcType=VARCHAR},
#{demandName,jdbcType=VARCHAR}, #{followPeople,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{customNum,jdbcType=VARCHAR}, #{stepModel,jdbcType=VARCHAR}, #{prerequisite,jdbcType=LONGVARCHAR},
#{remark,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR},
#{expectedResult,jdbcType=LONGVARCHAR}, #{customFields,jdbcType=LONGVARCHAR})
</insert>
@ -200,9 +200,6 @@
<if test="method != null">
`method`,
</if>
<if test="prerequisite != null">
prerequisite,
</if>
<if test="createTime != null">
create_time,
</if>
@ -245,6 +242,9 @@
<if test="stepModel != null">
step_model,
</if>
<if test="prerequisite != null">
prerequisite,
</if>
<if test="remark != null">
remark,
</if>
@ -289,9 +289,6 @@
<if test="method != null">
#{method,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
#{prerequisite,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
@ -334,6 +331,9 @@
<if test="stepModel != null">
#{stepModel,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
#{prerequisite,jdbcType=LONGVARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=LONGVARCHAR},
</if>
@ -387,9 +387,6 @@
<if test="record.method != null">
`method` = #{record.method,jdbcType=VARCHAR},
</if>
<if test="record.prerequisite != null">
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
@ -432,6 +429,9 @@
<if test="record.stepModel != null">
step_model = #{record.stepModel,jdbcType=VARCHAR},
</if>
<if test="record.prerequisite != null">
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=LONGVARCHAR},
</if>
@ -463,7 +463,6 @@
maintainer = #{record.maintainer,jdbcType=VARCHAR},
priority = #{record.priority,jdbcType=VARCHAR},
`method` = #{record.method,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
test_id = #{record.testId,jdbcType=VARCHAR},
@ -478,6 +477,7 @@
`status` = #{record.status,jdbcType=VARCHAR},
custom_num = #{record.customNum,jdbcType=VARCHAR},
step_model = #{record.stepModel,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
remark = #{record.remark,jdbcType=LONGVARCHAR},
steps = #{record.steps,jdbcType=LONGVARCHAR},
step_description = #{record.stepDescription,jdbcType=LONGVARCHAR},
@ -498,7 +498,6 @@
maintainer = #{record.maintainer,jdbcType=VARCHAR},
priority = #{record.priority,jdbcType=VARCHAR},
`method` = #{record.method,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
test_id = #{record.testId,jdbcType=VARCHAR},
@ -544,9 +543,6 @@
<if test="method != null">
`method` = #{method,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
prerequisite = #{prerequisite,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
@ -589,6 +585,9 @@
<if test="stepModel != null">
step_model = #{stepModel,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=LONGVARCHAR},
</if>
@ -617,7 +616,6 @@
maintainer = #{maintainer,jdbcType=VARCHAR},
priority = #{priority,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
test_id = #{testId,jdbcType=VARCHAR},
@ -632,6 +630,7 @@
`status` = #{status,jdbcType=VARCHAR},
custom_num = #{customNum,jdbcType=VARCHAR},
step_model = #{stepModel,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
remark = #{remark,jdbcType=LONGVARCHAR},
steps = #{steps,jdbcType=LONGVARCHAR},
step_description = #{stepDescription,jdbcType=LONGVARCHAR},
@ -649,7 +648,6 @@
maintainer = #{maintainer,jdbcType=VARCHAR},
priority = #{priority,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
test_id = #{testId,jdbcType=VARCHAR},

View File

@ -56,21 +56,17 @@ public class TestCaseExcelDataCn extends TestCaseExcelData {
@ColumnWidth(50)
@ExcelProperty("前置条件")
@Length(min = 0, max = 500)
private String prerequisite;
@ColumnWidth(50)
@ExcelProperty("备注")
@Length(max = 1000)
private String remark;
@ColumnWidth(50)
@ExcelProperty("步骤描述")
@Length(max = 1000)
private String stepDesc;
@ColumnWidth(50)
@ExcelProperty("预期结果")
@Length(max = 1000)
private String stepResult;
}

View File

@ -56,21 +56,17 @@ public class TestCaseExcelDataTw extends TestCaseExcelData {
@ColumnWidth(50)
@ExcelProperty("前置條件")
@Length(min = 0, max = 1000)
private String prerequisite;
@ColumnWidth(50)
@ExcelProperty("備註")
@Length(max = 1000)
private String remark;
@ColumnWidth(50)
@ExcelProperty("步驟描述")
@Length(max = 1000)
private String stepDesc;
@ColumnWidth(50)
@ExcelProperty("預期結果")
@Length(max = 1000)
private String stepResult;
}

View File

@ -57,21 +57,17 @@ public class TestCaseExcelDataUs extends TestCaseExcelData {
@ColumnWidth(50)
@ExcelProperty("Prerequisite")
@Length(min = 0, max = 1000)
private String prerequisite;
@ColumnWidth(50)
@ExcelProperty("Remark")
@Length(max = 1000)
private String remark;
@ColumnWidth(50)
@ExcelProperty("Step description")
@Length(max = 1000)
private String stepDesc;
@ColumnWidth(50)
@ExcelProperty("Step result")
@Length(max = 1000)
private String stepResult;
}

View File

@ -208,10 +208,6 @@ public class TestCaseService {
criteria.andTestIdEqualTo(testCase.getTestId());
}
if (StringUtils.isNotBlank(testCase.getPrerequisite())) {
criteria.andPrerequisiteEqualTo(testCase.getPrerequisite());
}
if (StringUtils.isNotBlank(testCase.getId())) {
criteria.andIdNotEqualTo(testCase.getId());
}
@ -222,10 +218,12 @@ public class TestCaseService {
if (!CollectionUtils.isEmpty(caseList)) {
String caseRemark = testCase.getRemark();
String caseSteps = testCase.getSteps();
String casePrerequisite = testCase.getPrerequisite();
for (TestCaseWithBLOBs tc : caseList) {
String steps = tc.getSteps();
String remark = tc.getRemark();
if (StringUtils.equals(steps, caseSteps) && StringUtils.equals(remark, caseRemark)) {
String prerequisite = tc.getPrerequisite();
if (StringUtils.equals(steps, caseSteps) && StringUtils.equals(remark, caseRemark) && StringUtils.equals(prerequisite, casePrerequisite)) {
//MSException.throwException(Translator.get("test_case_already_exists"));
return tc;
}

View File

@ -256,3 +256,6 @@ WHERE `type`='test_plan_function_test_case';
-- 自定义用例ID
alter table project add custom_num tinyint(1) default 0 null comment '是否开启自定义ID(默认关闭)';
alter table test_case add custom_num varchar(64) null comment 'custom num';
-- 修改前置条件为text
ALTER TABLE test_case MODIFY COLUMN prerequisite text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'Test case prerequisite condition';

View File

@ -77,7 +77,7 @@
<table tableName="test_case_review_scenario"/>
<table tableName="test_plan"/>
<table tableName="test_case_test"/>-->
<table tableName="test_case_template"></table>
<table tableName="test_case"></table>
<!-- <table tableName="custom_field"></table>-->
<!-- <table tableName="test_case"></table>-->
<table tableName="test_case"></table>