fix(接口测试): 修复由于TCP取样器的className没有默认值造成的问题

--bug=1013827
--user=宋天阳
【接口测试】github#14394,TCP接口定义导入JMX生成的接口(没选tcpclient),在test页面点击测试,页面无响应
https://www.tapd.cn/55049933/s/1174847
This commit is contained in:
song-tianyang 2022-06-07 15:36:20 +08:00 committed by f2c-ci-robot[bot]
parent e0e89283e3
commit e630ced5c4
2 changed files with 8 additions and 1 deletions

View File

@ -294,7 +294,11 @@ public class MsTCPSampler extends MsTestElement {
ElementUtil.setBaseParams(tcpSampler, this.getParent(), config, this.getId(), this.getIndex());
tcpSampler.setProperty(TestElement.TEST_CLASS, TCPSampler.class.getName());
tcpSampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TCPSamplerGui"));
tcpSampler.setClassname(this.getClassname());
if(StringUtils.isEmpty(this.getClassname())){
tcpSampler.setClassname("TCPClientImpl");
}else{
tcpSampler.setClassname(this.getClassname());
}
tcpSampler.setServer(this.getServer());
tcpSampler.setPort(this.getPort());
tcpSampler.setConnectTimeout(this.getCtimeout());

View File

@ -271,6 +271,9 @@ export default {
},
created() {
this.currentProjectId = getCurrentProjectID();
if (!this.request.classname) {
this.request.classname = "TCPClientImpl";
}
if (!this.request.parameters) {
this.$set(this.request, 'parameters', []);
this.request.parameters = [];