我想用Jmeter.Can对基于Jpos的ISO消息和响应(TPS)进行功能测试--任何人都可以指导我吗?我需要在Jmeter.As中安装任何插件吗?我尝试在我的system.But中安装J计量器,在侦听器中看不到任何JPOS插件来启动Jpos中的with.Dev使用套接字连接。
发布于 2018-11-28 08:06:30
我不认为你能找到任何插件,但是你应该能够使用jPOS客户端库从JSR223取样器
jpos/build/libs/jpos-x.x.x.jar
复制到JMeter类路径 (以及依赖项,如果您还没有它们)更多信息:
发布于 2018-12-11 09:01:19
我们可以将XML或rawMessage从XML发送到jpos服务器。
并且可以实现JPosTCPClient
public class JPosTCPClient extends TCPClientImpl {
private static final Logger log = LoggingManager.getLoggerForClass();
private String containsString = "</isomsg>";
private boolean filterEnabled = true;
public JPosTCPClient() {
filterEnabled = Boolean.parseBoolean(JMeterUtils.getPropDefault("jpos.tcp.use", "true"));
containsString = JMeterUtils.getPropDefault("jpos.tcp.contains", "</isomsg>");
}
/**
* Reads data until the defined EOL byte is reached.
* If there is no EOL byte defined, then reads until
* the end of the stream is reached.
*/
@Override
public String read(InputStream is) {
byte[] buffer = new byte[4096];
ByteArrayOutputStream w = new ByteArrayOutputStream();
int x = 0;
boolean contains = false;
try {
while ((x = is.read(buffer)) > -1) {
w.write(buffer, 0, x);
if(filterEnabled){
String response = new String(buffer);
if(response.contains(containsString)){
contains = true;
break;
} else {
System.out.println("Contents: " + response);
}
}
}
if(filterEnabled && !contains){
System.out.println("Skipped containsString checking, x length:" + x);
}
} catch (SocketTimeoutException e) {
// drop out to handle buffer
System.out.println(e.getMessage());
} catch (InterruptedIOException e) {
// drop out to handle buffer
System.out.println(e.getMessage());
} catch (IOException e) {
System.out.println(e.getMessage());
log.warn("Read error:" + e);
return "";
}
// do we need to close byte array (or flush it?)
log.debug("Read: " + w.size() + "\n" + w.toString());
return w.toString();
}
}
https://stackoverflow.com/questions/53522284
复制相似问题