提交 e3b43782 编写于 作者: C chenjianxing

refactor(接口测试): 支持提取接口到变量

上级 18c300f8
......@@ -37,4 +37,8 @@ public class SqlRequest implements Request {
private JSR223PreProcessor jsr223PreProcessor;
@JSONField(ordinal = 12)
private JSR223PostProcessor jsr223PostProcessor;
@JSONField(ordinal = 13)
private String resultVariable;
@JSONField(ordinal = 14)
private String variableNames;
}
Subproject commit 321c869938357e8c2253e5bd86c963828664ae23
Subproject commit d5b4969642fd8d10cc2f949d7377e0a0e5217a3a
......@@ -11,6 +11,14 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('api_test.request.sql.result_variable')" prop="resultVariable">
<el-input v-model="request.resultVariable" maxlength="300" show-word-limit/>
</el-form-item>
<el-form-item :label="$t('api_test.request.sql.variable_names')" prop="variableNames">
<el-input v-model="request.variableNames" maxlength="300" show-word-limit/>
</el-form-item>
<!--<el-form-item :label="'查询类型'" prop="protocol">-->
<!--<el-select v-model="request.queryType">-->
<!--<el-option label="dubbo://" :value="protocols.DUBBO"/>-->
......
......@@ -281,31 +281,16 @@ export class JDBCSampler extends DefaultTestElement {
this.stringProp("dataSource", request.dataSource);
this.stringProp("query", request.query);
this.stringProp("queryTimeout", request.queryTimeout);
this.stringProp("resultVariable", request.resultVariable);
this.stringProp("variableNames", request.variableNames);
this.stringProp("queryArguments");
this.stringProp("queryArgumentsTypes");
this.stringProp("resultSetMaxRows");
this.stringProp("resultVariable");
this.stringProp("variableNames");
this.stringProp("resultSetHandler", 'Store as String');
this.stringProp("queryType", 'Callable Statement');
}
}
// <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC Request" enabled="true">
// <stringProp name="dataSource">test</stringProp>
// <stringProp name="query">select id from test_plan;
// select name from test_plan;
// </stringProp>
// <stringProp name="queryArguments"></stringProp>
// <stringProp name="queryArgumentsTypes"></stringProp>
// <stringProp name="queryTimeout"></stringProp>
// <stringProp name="queryType">Callable Statement</stringProp>
// <stringProp name="resultSetHandler">Store as String</stringProp>
// <stringProp name="resultSetMaxRows"></stringProp>
// <stringProp name="resultVariable"></stringProp>
// <stringProp name="variableNames"></stringProp>
// </JDBCSampler>
export class HTTPSamplerProxy extends DefaultTestElement {
constructor(testName, options = {}) {
super('HTTPSamplerProxy', 'HttpTestSampleGui', 'HTTPSamplerProxy', testName);
......
......@@ -482,6 +482,8 @@ export class SqlRequest extends Request {
this.id = options.id || uuid();
this.name = options.name;
this.useEnvironment = options.useEnvironment;
this.resultVariable = options.resultVariable;
this.variableNames = options.variableNames;
this.debugReport = undefined;
this.dataSource = options.dataSource;
this.query = options.query;
......@@ -1080,7 +1082,7 @@ class JMXGenerator {
this.addConstantsTimer(sampler, request);
if (request.controller.isValid() && request.controller.enable) {
if (request.controller && request.controller.isValid() && request.controller.enable) {
if (request.controller instanceof IfController) {
let controller = this.getController(sampler, request);
threadGroup.put(controller);
......@@ -1207,7 +1209,7 @@ class JMXGenerator {
}
addConstantsTimer(sampler, request) {
if (request.timer.isValid() && request.timer.enable) {
if (request.timer && request.timer.isValid() && request.timer.enable) {
sampler.put(new JMXConstantTimer(request.timer.label(), request.timer));
}
}
......
Subproject commit f2d5a342c82e629f510550d5778d752bb73bf5e7
Subproject commit 0a375848d034d20eaf05caf11769e1c75c39235c
......@@ -551,6 +551,8 @@ export default {
query_timeout: "Max Wait(ms)",
name_cannot_be_empty: "SQL request name cannot be empty",
dataSource_cannot_be_empty: "SQL request datasource cannot be empty",
result_variable: "Result variable",
variable_names: "Variable names",
},
api_import: {
label: "Import",
......
......@@ -552,6 +552,8 @@ export default {
query_timeout: "最大等待时间(ms)",
name_cannot_be_empty: "SQL请求名称不能为空",
dataSource_cannot_be_empty: "SQL请求数据源不能为空",
result_variable: "存储结果",
variable_names: "按列存储",
}
},
api_import: {
......
......@@ -552,6 +552,8 @@ export default {
query_timeout: "最大等待時間(ms)",
name_cannot_be_empty: "SQL請求名稱不能為空",
dataSource_cannot_be_empty: "SQL請求數據源不能為空",
result_variable: "存儲結果",
variable_names: "按列存儲",
}
},
api_import: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册