fix(接口测试): 修复LengthPrefixedBinaryTCPClient无法发送报文的问题

--bug=1011019 --user=宋天阳
【接口测试】github#11306,TCP请求,同样的参数在接口定义、快捷调试和接口自动化中的响应结果不一样,并且把场景中的TCP请求另存为接口存在显示问题
https://www.tapd.cn/55049933/s/1125965
This commit is contained in:
song-tianyang 2022-03-25 15:54:10 +08:00 committed by CountryBuilder
parent b9d994fa0b
commit da786fbf8e
2 changed files with 12 additions and 5 deletions

View File

@ -273,7 +273,14 @@ public class MsTCPSampler extends MsTestElement {
tcpSampler.setProperty(TCPSampler.NODELAY, this.isNodelay());
tcpSampler.setCloseConnection(String.valueOf(this.isCloseConnection()));
tcpSampler.setSoLinger(this.getSoLinger());
if(StringUtils.equalsIgnoreCase("LengthPrefixedBinaryTCPClientImpl",this.classname)){
//LengthPrefixedBinaryTCPClientImpl取样器不可以设置eolByte
this.eolByte = null;
}else {
tcpSampler.setEolByte(this.getEolByte());
}
if (StringUtils.isNotEmpty(this.timeout)) {
tcpSampler.setTimeout(this.timeout);
}
@ -380,7 +387,9 @@ public class MsTCPSampler extends MsTestElement {
configTestElement.setProperty(TCPSampler.NODELAY, this.isNodelay());
configTestElement.setProperty(TCPSampler.CLOSE_CONNECTION, this.isCloseConnection());
configTestElement.setProperty(TCPSampler.SO_LINGER, this.getSoLinger());
if(!StringUtils.equalsIgnoreCase("LengthPrefixedBinaryTCPClientImpl",this.classname)){
configTestElement.setProperty(TCPSampler.EOL_BYTE, this.getEolByte());
}
configTestElement.setProperty(TCPSampler.SO_LINGER, this.getSoLinger());
configTestElement.setProperty(ConfigTestElement.USERNAME, this.getUsername());
configTestElement.setProperty(ConfigTestElement.PASSWORD, this.getPassword());

View File

@ -38,10 +38,8 @@ public class ApiScenarioReportResultService {
if (StringUtils.isNotEmpty(item.getName()) && item.getName().startsWith("Transaction=") && CollectionUtils.isEmpty(item.getSubRequestResults())) {
LoggerUtil.debug("合并事物请求暂不入库");
} else {
if (!StringUtils.startsWithAny(item.getName(), "PRE_PROCESSOR_ENV_", "POST_PROCESSOR_ENV_")) {
apiScenarioReportResultMapper.insert(this.newApiScenarioReportResult(reportId, item));
}
}
});
}
}