refactor(接口测试): 删掉esb遗留代码

--bug=1023982 --user=王孝刚 [接口测试] github#22422 TCP 协议前置脚本-报文头添加长度脚本只使用于
groovy,其他类型脚本报错,建议修改脚本模板,或者隐藏其他脚本的生成入口
https://www.tapd.cn/55049933/s/1346229
This commit is contained in:
wxg0103 2023-03-07 16:17:47 +08:00 committed by wxg0103
parent 370e8ab17c
commit 879db0a6b6
2 changed files with 0 additions and 74 deletions

View File

@ -122,38 +122,6 @@ export default {
},
],
},
{
title: this.$t('project.code_segment.report_handle'),
hideScript: this.isHideScript(),
children: [
{
title: this.$t('api_test.request.processor.code_add_report_length'),
value:
'String report = ctx.getCurrentSampler().getRequestData();\n' +
'if(report!=null){\n' +
' //补足8位长度前置补0\n' +
' String reportlengthStr = String.format("%08d",report.length());\n' +
' report = reportlengthStr+report;\n' +
' ctx.getCurrentSampler().setRequestData(report);\n' +
'}',
},
{
title: this.$t('api_test.request.processor.code_hide_report_length'),
value:
'//Get response data\n' +
'String returnData = prev.getResponseDataAsString();\n' +
'if(returnData!=null&&returnData.length()>8){\n' +
'//remove 8 report length \n' +
' String subStringData = returnData.substring(8,returnData.length());\n' +
' if(subStringData.startsWith("<")){\n' +
' returnData = subStringData;\n' +
' prev.setResponseData(returnData);\n' +
' }\n' +
'}',
disabled: this.isPreProcessor,
},
],
},
],
isCodeEditAlive: true,
languages: ['beanshell', 'python', 'groovy', 'javascript'],
@ -210,9 +178,6 @@ export default {
}
this.reload();
},
isHideScript() {
return this.protocol !== 'TCP';
},
reload() {
this.isCodeEditAlive = false;
this.$nextTick(() => (this.isCodeEditAlive = true));

View File

@ -148,42 +148,6 @@ export default {
},
],
},
{
title: this.$t("project.code_segment.report_handle"),
hideScript: this.isHideScript(),
children: [
{
title: this.$t(
"api_test.request.processor.code_add_report_length"
),
value:
"String report = ctx.getCurrentSampler().getRequestData();\n" +
"if(report!=null){\n" +
" //补足8位长度前置补0\n" +
' String reportlengthStr = String.format("%08d",report.length());\n' +
" report = reportlengthStr+report;\n" +
" ctx.getCurrentSampler().setRequestData(report);\n" +
"}",
},
{
title: this.$t(
"api_test.request.processor.code_hide_report_length"
),
value:
"//Get response data\n" +
"String returnData = prev.getResponseDataAsString();\n" +
"if(returnData!=null&&returnData.length()>8){\n" +
"//remove 8 report length \n" +
" String subStringData = returnData.substring(8,returnData.length());\n" +
' if(subStringData.startsWith("<")){\n' +
" returnData = subStringData;\n" +
" prev.setResponseData(returnData);\n" +
" }\n" +
"}",
disabled: this.isPreProcessor,
},
],
},
],
isCodeEditAlive: true,
languages: ["beanshell", "python", "groovy", "javascript"],
@ -246,9 +210,6 @@ export default {
}
this.reload();
},
isHideScript() {
return this.protocol !== "TCP";
},
reload() {
this.isCodeEditAlive = false;
this.$nextTick(() => (this.isCodeEditAlive = true));