Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
55e6c252
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 3 年多
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
55e6c252
编写于
7月 06, 2020
作者:
W
wenyann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
jenkins相关接口
上级
9f9109fb
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
48 addition
and
51 deletion
+48
-51
backend/src/main/java/io/metersphere/api/controller/APITestController.java
...java/io/metersphere/api/controller/APITestController.java
+7
-2
backend/src/main/java/io/metersphere/api/service/APITestService.java
.../main/java/io/metersphere/api/service/APITestService.java
+5
-1
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
...java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
+10
-14
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
...metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
+6
-23
backend/src/main/java/io/metersphere/track/controller/TestCaseController.java
...a/io/metersphere/track/controller/TestCaseController.java
+1
-2
backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java
...ersphere/track/controller/TestPlanTestCaseController.java
+15
-9
backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java
.../track/request/testplancase/QueryTestPlanCaseRequest.java
+4
-0
未找到文件。
backend/src/main/java/io/metersphere/api/controller/APITestController.java
浏览文件 @
55e6c252
...
...
@@ -45,10 +45,15 @@ public class APITestController {
return
PageUtils
.
setPageInfo
(
page
,
apiTestService
.
list
(
request
));
}
@GetMapping
(
"/list/{projectId}"
)
public
List
<
ApiTest
>
list
(
@PathVariable
String
projectId
)
{
return
apiTestService
.
getApiTestByProjectId
(
projectId
);
}
/*查询某个api测试状态*/
@GetMapping
(
"/list/all/{testId}"
)
public
ApiTest
list
(
@PathVariable
String
testId
)
{
return
apiTestService
.
getApiTestBy
Projec
tId
(
testId
);
public
ApiTest
apiState
(
@PathVariable
String
testId
)
{
return
apiTestService
.
getApiTestBy
Tes
tId
(
testId
);
}
@PostMapping
(
value
=
"/schedule/update"
)
...
...
backend/src/main/java/io/metersphere/api/service/APITestService.java
浏览文件 @
55e6c252
...
...
@@ -115,10 +115,14 @@ public class APITestService {
return
apiTest
;
}
public
ApiTest
getApiTestBy
Projec
tId
(
String
testId
)
{
public
ApiTest
getApiTestBy
Tes
tId
(
String
testId
)
{
return
apiTestMapper
.
selectByPrimaryKey
(
testId
);
}
public
List
<
ApiTest
>
getApiTestByProjectId
(
String
projectId
)
{
return
extApiTestMapper
.
getApiTestByProjectId
(
projectId
);
}
public
void
delete
(
String
testId
)
{
deleteFileByTestId
(
testId
);
apiReportService
.
deleteByTestId
(
testId
);
...
...
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
浏览文件 @
55e6c252
...
...
@@ -40,7 +40,7 @@
<if
test=
"values != null and values.size() > 0"
>
and test_case.${key} in
<foreach
collection=
"values"
item=
"value"
separator=
","
open=
"("
close=
")"
>
#{value}
#{value}
</foreach>
</if>
</foreach>
...
...
@@ -54,22 +54,18 @@
</if>
</select>
<select
id=
"listByMethod"
resultType=
"io.metersphere.track.dto.TestCaseDTO"
>
select test_case.* from test_case
SELECT id,name,status,project_id,type from api_test
<where>
<if
test=
"request.method != null"
>
and test_case.method =#{request.method}
</if>
<if
test=
"request.nodeIds != null and request.nodeIds.size() > 0"
>
and test_case.node_id in
<foreach
collection=
"request.nodeIds"
item=
"nodeId"
separator=
","
open=
"("
close=
")"
>
#{nodeId}
</foreach>
<if
test=
"request.projectId!=null"
>
and project_id=#{request.projectId}
</if>
<if
test=
"request.projectId != null"
>
and test_case.project_id = #{request.projectId}
</where>
UNION ALL
select id,name,status,project_id,type from load_test
<where>
<if
test=
"request.projectId!=null"
>
and project_id= #{request.projectId}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
浏览文件 @
55e6c252
...
...
@@ -68,34 +68,17 @@
from test_plan_test_case
inner join test_case on test_plan_test_case.case_id = test_case.id
<where>
<if
test=
"request.name != null"
>
and test_case.name like CONCAT('%', #{request.name},'%')
</if>
<if
test=
"request.id != null"
>
and test_case.id = #{request.id}
</if>
<if
test=
"request.node != null"
>
and test_case.node_id =#{request.node}
</if>
<if
test=
"request.status != null"
>
and test_plan_test_case.status = #{request.status}
</if>
<if
test=
"request.executor != null"
>
and test_plan_test_case.executor = #{request.executor}
</if>
<if
test=
"request.planId != null"
>
and test_plan_test_case.plan_id = #{request.planId}
</if>
<if
test=
"request.filters != null and request.filters.size() > 0"
>
<foreach
collection=
"request.filters.entrySet()"
index=
"key"
item=
"values"
>
<if
test=
"values != null and values.size() > 0"
>
and ${key} in
<foreach
collection=
"values"
item=
"value"
separator=
","
open=
"("
close=
")"
>
#{value}
</foreach>
</if>
<if
test=
"request.nodePaths != null and request.nodePaths.size() > 0"
>
and test_case.node_path in
<foreach
collection=
"request.nodePaths"
item=
"nodePaths"
separator=
","
open=
"("
close=
")"
>
#{nodePaths}
</foreach>
</if>
</where>
</select>
...
...
backend/src/main/java/io/metersphere/track/controller/TestCaseController.java
浏览文件 @
55e6c252
...
...
@@ -43,12 +43,11 @@ public class TestCaseController {
return
testCaseService
.
listTestCase
(
request
);
}
/*项目下自动测试
用例
*/
/*项目下自动测试*/
@GetMapping
(
"/list/method/{projectId}"
)
public
List
<
TestCaseDTO
>
listByMethod
(
@PathVariable
String
projectId
)
{
QueryTestCaseRequest
request
=
new
QueryTestCaseRequest
();
request
.
setProjectId
(
projectId
);
request
.
setMethod
(
"auto"
);
return
testCaseService
.
listTestCaseMthod
(
request
);
}
...
...
backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java
浏览文件 @
55e6c252
...
...
@@ -16,6 +16,8 @@ import org.apache.shiro.authz.annotation.RequiresRoles;
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"
)
...
...
@@ -31,11 +33,15 @@ public class TestPlanTestCaseController {
return
PageUtils
.
setPageInfo
(
page
,
testPlanTestCaseService
.
list
(
request
));
}
@GetMapping
(
"/list/{planId}/{nodeId}"
)
public
List
<
TestPlanCaseDTO
>
getTestPlanCases
(
@PathVariable
String
planId
,
@PathVariable
String
nodeId
)
{
/*jenkins测试计划下的测试用例*/
@GetMapping
(
"/list/node/{planId}/{nodePaths}"
)
public
List
<
TestPlanCaseDTO
>
getTestPlanCases
(
@PathVariable
String
planId
,
@PathVariable
String
nodePaths
)
{
String
nodePath
=
nodePaths
.
replace
(
"f"
,
"/"
);
String
[]
array
=
nodePath
.
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
array
);
QueryTestPlanCaseRequest
request
=
new
QueryTestPlanCaseRequest
();
request
.
setPlanId
(
planId
);
request
.
setNode
(
nodeId
);
request
.
setNode
Paths
(
list
);
return
testPlanTestCaseService
.
listByNode
(
request
);
}
...
...
@@ -50,36 +56,36 @@ public class TestPlanTestCaseController {
}
@PostMapping
(
"pending/{count}"
)
public
List
<
TestPlanCaseDTO
>
getPrepareTestCases
(
@PathVariable
int
count
,
@RequestBody
QueryTestPlanCaseRequest
request
){
public
List
<
TestPlanCaseDTO
>
getPrepareTestCases
(
@PathVariable
int
count
,
@RequestBody
QueryTestPlanCaseRequest
request
)
{
return
testPlanTestCaseService
.
getPendingTestCases
(
request
,
count
);
}
@PostMapping
(
"/list/all"
)
public
List
<
TestPlanCaseDTO
>
getTestPlanCases
(
@RequestBody
QueryTestPlanCaseRequest
request
){
public
List
<
TestPlanCaseDTO
>
getTestPlanCases
(
@RequestBody
QueryTestPlanCaseRequest
request
)
{
return
testPlanTestCaseService
.
list
(
request
);
}
@PostMapping
(
"/edit"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_MANAGER
},
logical
=
Logical
.
OR
)
public
void
editTestCase
(
@RequestBody
TestPlanTestCaseWithBLOBs
testPlanTestCase
){
public
void
editTestCase
(
@RequestBody
TestPlanTestCaseWithBLOBs
testPlanTestCase
)
{
testPlanTestCaseService
.
editTestCase
(
testPlanTestCase
);
}
@PostMapping
(
"/batch/edit"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_MANAGER
},
logical
=
Logical
.
OR
)
public
void
editTestCaseBath
(
@RequestBody
TestPlanCaseBatchRequest
request
){
public
void
editTestCaseBath
(
@RequestBody
TestPlanCaseBatchRequest
request
)
{
testPlanTestCaseService
.
editTestCaseBath
(
request
);
}
@PostMapping
(
"/batch/delete"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_MANAGER
},
logical
=
Logical
.
OR
)
public
void
deleteTestCaseBath
(
@RequestBody
TestPlanCaseBatchRequest
request
){
public
void
deleteTestCaseBath
(
@RequestBody
TestPlanCaseBatchRequest
request
)
{
testPlanTestCaseService
.
deleteTestCaseBath
(
request
);
}
@PostMapping
(
"/delete/{id}"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_MANAGER
},
logical
=
Logical
.
OR
)
public
int
deleteTestCase
(
@PathVariable
String
id
){
public
int
deleteTestCase
(
@PathVariable
String
id
)
{
return
testPlanTestCaseService
.
deleteTestCase
(
id
);
}
...
...
backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java
浏览文件 @
55e6c252
...
...
@@ -14,6 +14,8 @@ public class QueryTestPlanCaseRequest extends TestPlanTestCase {
private
List
<
String
>
nodeIds
;
private
List
<
String
>
nodePaths
;
private
List
<
OrderRequest
>
orders
;
private
Map
<
String
,
List
<
String
>>
filters
;
...
...
@@ -29,4 +31,6 @@ public class QueryTestPlanCaseRequest extends TestPlanTestCase {
private
String
status
;
private
String
node
;
private
String
method
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录