Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王飞
vehicle-quality-review
Commits
ae297232
Commit
ae297232
authored
Feb 18, 2024
by
王飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、新建“测试用例”&“用例矩阵”相关代码
parent
443fcf00
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
267 additions
and
0 deletions
+267
-0
TestUseCase.java
...ty-review/src/main/java/com/ruoyi/domain/TestUseCase.java
+80
-0
MatrixColumnVO.java
...iew/src/main/java/com/ruoyi/domain/vo/MatrixColumnVO.java
+17
-0
MatrixRowVO.java
...review/src/main/java/com/ruoyi/domain/vo/MatrixRowVO.java
+19
-0
TestUseCaseMapper.java
...iew/src/main/java/com/ruoyi/mapper/TestUseCaseMapper.java
+18
-0
MatrixService.java
...review/src/main/java/com/ruoyi/service/MatrixService.java
+9
-0
TestUseCaseService.java
...w/src/main/java/com/ruoyi/service/TestUseCaseService.java
+13
-0
MatrixServiceImpl.java
...c/main/java/com/ruoyi/service/impl/MatrixServiceImpl.java
+28
-0
TestUseCaseServiceImpl.java
...n/java/com/ruoyi/service/impl/TestUseCaseServiceImpl.java
+22
-0
MatrixResponse.java
.../src/main/java/com/ruoyi/web/response/MatrixResponse.java
+18
-0
TestUseCaseMapper.xml
...ty-review/src/main/resources/mapper/TestUseCaseMapper.xml
+23
-0
MatrixTest.java
ruoyi-admin/src/test/java/com/ruoyi/MatrixTest.java
+20
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/TestUseCase.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 测试用例
* @TableName t_test_usecase
*/
@TableName
(
value
=
"t_test_usecase"
)
@Data
public
class
TestUseCase
implements
Serializable
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
id
;
/**
* 测试场景id
*/
@ApiModelProperty
(
"测试场景id"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
testScenarioId
;
/**
* 测试类型id
*/
@ApiModelProperty
(
"测试类型id"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
testTypeId
;
/**
* 用例编号
*/
@ApiModelProperty
(
"用例编号"
)
private
String
usecaseNo
;
/**
* 用例名称
*/
@ApiModelProperty
(
"用例名称"
)
private
String
name
;
/**
* 工具
*/
@ApiModelProperty
(
"工具"
)
private
String
tools
;
/**
* 对应输入
*/
@ApiModelProperty
(
"对应输入"
)
private
String
input
;
/**
* 用例描述
*/
@ApiModelProperty
(
"用例描述"
)
private
String
description
;
/**
* 返回用例在矩阵中的坐标
* @return
*/
public
String
getCoordinates
()
{
return
String
.
valueOf
(
testScenarioId
)
+
String
.
valueOf
(
testTypeId
);
}
}
\ No newline at end of file
quality-review/src/main/java/com/ruoyi/domain/vo/MatrixColumnVO.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
value
=
"MatrixColumnVO"
,
description
=
"用例矩阵-列"
)
@Data
public
class
MatrixColumnVO
{
@ApiModelProperty
(
"列名称"
)
private
String
title
;
@ApiModelProperty
(
"用例id;没有用例则为null"
)
private
Long
useCaseId
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/MatrixRowVO.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
value
=
"MatrixRowVO"
,
description
=
"用例矩阵-行"
)
@Data
public
class
MatrixRowVO
{
@ApiModelProperty
(
"行名称"
)
private
String
name
;
@ApiModelProperty
(
"当前行包含的所有列"
)
private
List
<
MatrixColumnVO
>
columns
;
}
quality-review/src/main/java/com/ruoyi/mapper/TestUseCaseMapper.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
mapper
;
import
com.ruoyi.domain.TestUseCase
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* @author wangfei
* @description 针对表【t_test_usecase(测试用例)】的数据库操作Mapper
* @createDate 2024-02-18 13:41:28
* @Entity com.ruoyi.domain.TestUseCase
*/
public
interface
TestUseCaseMapper
extends
BaseMapper
<
TestUseCase
>
{
}
quality-review/src/main/java/com/ruoyi/service/MatrixService.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
service
;
import
com.ruoyi.web.response.MatrixResponse
;
public
interface
MatrixService
{
MatrixResponse
getMatrix
();
}
quality-review/src/main/java/com/ruoyi/service/TestUseCaseService.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
service
;
import
com.ruoyi.domain.TestUseCase
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* @author wangfei
* @description 针对表【t_test_usecase(测试用例)】的数据库操作Service
* @createDate 2024-02-18 13:41:28
*/
public
interface
TestUseCaseService
extends
IService
<
TestUseCase
>
{
}
quality-review/src/main/java/com/ruoyi/service/impl/MatrixServiceImpl.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
service
.
impl
;
import
com.ruoyi.domain.TestUseCase
;
import
com.ruoyi.service.MatrixService
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.web.response.MatrixResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
MatrixServiceImpl
implements
MatrixService
{
@Autowired
private
TestUseCaseService
testUseCaseService
;
@Override
public
MatrixResponse
getMatrix
()
{
List
<
TestUseCase
>
useCases
=
testUseCaseService
.
list
();
return
null
;
}
}
quality-review/src/main/java/com/ruoyi/service/impl/TestUseCaseServiceImpl.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.domain.TestUseCase
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.mapper.TestUseCaseMapper
;
import
org.springframework.stereotype.Service
;
/**
* @author wangfei
* @description 针对表【t_test_usecase(测试用例)】的数据库操作Service实现
* @createDate 2024-02-18 13:41:28
*/
@Service
public
class
TestUseCaseServiceImpl
extends
ServiceImpl
<
TestUseCaseMapper
,
TestUseCase
>
implements
TestUseCaseService
{
}
quality-review/src/main/java/com/ruoyi/web/response/MatrixResponse.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
.
web
.
response
;
import
com.ruoyi.domain.vo.MatrixColumnVO
;
import
com.ruoyi.domain.vo.MatrixRowVO
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
value
=
"MatrixResponse"
,
description
=
"用例矩阵"
)
@Data
public
class
MatrixResponse
{
private
List
<
MatrixColumnVO
>
header
;
private
List
<
MatrixRowVO
>
rows
;
}
quality-review/src/main/resources/mapper/TestUseCaseMapper.xml
0 → 100644
View file @
ae297232
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.mapper.TestUseCaseMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.domain.TestUseCase"
>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<result
property=
"testScenarioId"
column=
"test_scenario_id"
jdbcType=
"BIGINT"
/>
<result
property=
"testTypeId"
column=
"test_type_id"
jdbcType=
"BIGINT"
/>
<result
property=
"usecaseNo"
column=
"usecase_no"
jdbcType=
"VARCHAR"
/>
<result
property=
"name"
column=
"name"
jdbcType=
"VARCHAR"
/>
<result
property=
"tools"
column=
"tools"
jdbcType=
"VARCHAR"
/>
<result
property=
"input"
column=
"input"
jdbcType=
"VARCHAR"
/>
<result
property=
"description"
column=
"description"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,test_scenario_id,test_type_id,
usecase_no,name,tools,
input,description
</sql>
</mapper>
ruoyi-admin/src/test/java/com/ruoyi/MatrixTest.java
0 → 100644
View file @
ae297232
package
com
.
ruoyi
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
java.util.ArrayList
;
@SpringBootTest
public
class
MatrixTest
{
@Test
public
void
generateMatrixTest
()
{
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment