Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
kt-keystone
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
kt-keystone
Commits
9f1e944b
提交
9f1e944b
authored
4月 27, 2022
作者:
mry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(web/base): 豪哥承诺,必有BUG
上级
021bdf60
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
2 行删除
+15
-2
CheckPointActuator.java
...a/org/matrix/actuators/checkpoint/CheckPointActuator.java
+2
-0
CaseActuator.java
.../main/java/org/matrix/actuators/usecase/CaseActuator.java
+4
-0
CompleteExpressionUtil.java
...ava/org/matrix/actuators/util/CompleteExpressionUtil.java
+9
-2
没有找到文件。
kt-base/src/main/java/org/matrix/actuators/checkpoint/CheckPointActuator.java
浏览文件 @
9f1e944b
...
@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.matrix.actuators.Actuator
;
import
org.matrix.actuators.Actuator
;
import
org.matrix.actuators.httpclient.HttpResponseDetail
;
import
org.matrix.actuators.httpclient.HttpResponseDetail
;
import
org.matrix.actuators.util.CompleteExpressionUtil
;
import
org.matrix.actuators.util.CompleteExpressionUtil
;
import
org.matrix.enums.ExecutionHistoryStatus
;
import
org.matrix.exception.CheckPointException
;
import
org.matrix.exception.CheckPointException
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.ClassPathResource
;
...
@@ -76,6 +77,7 @@ public class CheckPointActuator implements Actuator {
...
@@ -76,6 +77,7 @@ public class CheckPointActuator implements Actuator {
Object
jsonObject
=
Configuration
.
defaultConfiguration
().
jsonProvider
().
parse
(
httpResponseDetail
.
getResponseBody
());
Object
jsonObject
=
Configuration
.
defaultConfiguration
().
jsonProvider
().
parse
(
httpResponseDetail
.
getResponseBody
());
checkPointResult
.
addCheckPointResultDetail
(
jsonPathCheck
(
checkPoint
.
getJsonPathCheckPoint
(),
jsonObject
,
envId
,
projectId
));
checkPointResult
.
addCheckPointResultDetail
(
jsonPathCheck
(
checkPoint
.
getJsonPathCheckPoint
(),
jsonObject
,
envId
,
projectId
));
}
}
return
checkPointResult
;
return
checkPointResult
;
}
}
...
...
kt-base/src/main/java/org/matrix/actuators/usecase/CaseActuator.java
浏览文件 @
9f1e944b
...
@@ -166,7 +166,11 @@ public class CaseActuator implements Actuator {
...
@@ -166,7 +166,11 @@ public class CaseActuator implements Actuator {
//执行后置动作
//执行后置动作
executeMove
(
testCaseBto
.
getTestCase
().
getMoveAfterCase
()
executeMove
(
testCaseBto
.
getTestCase
().
getMoveAfterCase
()
,
envId
,
projectId
,
baseTestCaseResponseDetail
.
getResponseBody
(),
MoveStrategy
.
AFT_MOVE
);
,
envId
,
projectId
,
baseTestCaseResponseDetail
.
getResponseBody
(),
MoveStrategy
.
AFT_MOVE
);
if
(
checkPointResult
.
getFailNum
()>
0
){
changeExecutionHistoryStatus
(
ExecutionHistoryStatus
.
ERROR
);
}
else
{
changeExecutionHistoryStatus
(
ExecutionHistoryStatus
.
FINISH
);
changeExecutionHistoryStatus
(
ExecutionHistoryStatus
.
FINISH
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
dataSourceService
.
switchMainDataSource
();
dataSourceService
.
switchMainDataSource
();
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
kt-base/src/main/java/org/matrix/actuators/util/CompleteExpressionUtil.java
浏览文件 @
9f1e944b
...
@@ -26,7 +26,7 @@ public class CompleteExpressionUtil {
...
@@ -26,7 +26,7 @@ public class CompleteExpressionUtil {
public
static
final
String
JSON_PATH_REG
=
"\\{(\\s)*\\$.*?}|(<(\\s)*\\$.*?>)"
;
public
static
final
String
JSON_PATH_REG
=
"\\{(\\s)*\\$.*?}|(<(\\s)*\\$.*?>)"
;
public
static
final
String
ACTION_REG
=
"\\$(?=\\{(\\s)*(pre|mid|aft)[0-9]+\\.)(.*?)(?<=})(\\[(.*?)])?"
;
public
static
final
String
ACTION_REG
=
"\\$(?=\\{(\\s)*(pre|mid|aft)[0-9]+\\.)(.*?)(?<=})(\\[(.*?)])?
(\\<(.*?)>)?
"
;
public
static
final
String
ENV_VARIABLE_REG
=
"\\#\\{(.*?)}"
;
public
static
final
String
ENV_VARIABLE_REG
=
"\\#\\{(.*?)}"
;
...
@@ -90,7 +90,14 @@ public class CompleteExpressionUtil {
...
@@ -90,7 +90,14 @@ public class CompleteExpressionUtil {
public
String
completeJsonPathExpression
(
String
expression
,
Object
jsonObject
)
{
public
String
completeJsonPathExpression
(
String
expression
,
Object
jsonObject
)
{
String
result
=
expression
;
String
result
=
expression
;
result
=
regexExpression
(
result
,
JSON_PATH_REG
,
result
=
regexExpression
(
result
,
JSON_PATH_REG
,
jsonObject
,
(
o
,
s
)
->
JSON
.
toJSONString
(
JsonPath
.
read
(
o
,
s
.
substring
(
1
,
s
.
length
()
-
1
))));
jsonObject
,
(
o
,
s
)
->
{
Object
read
=
JsonPath
.
read
(
o
,
s
.
substring
(
1
,
s
.
length
()
-
1
));
if
(
read
instanceof
String
){
return
(
String
)
read
;
}
else
{
return
JSON
.
toJSONString
(
read
);
}
});
return
result
;
return
result
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论