使用多个客户端实例自动化 XMPP 服务器测试
我正在开发 XMPP 服务器的测试套件。目前,我已经实现了一个客户端,能够连接、创建帐户、发送从 XML 文件中获取的节、接收回复、将其存储在另一个文件中并将其与预期输出进行比较。我可以创建多个客户端,但我正在寻找并发操作。
我该如何让多个客户端相互通信?我的愿景 - 将客户端放入单独的线程中并提供“等待回复”等命令。
任何建议表示赞赏...
I'm working on a test suite for XMPP server. Currently I have implemented a client able to connect, create account, send stanzas taken from XML file, receive the reply, store it in another file and compare that with the expected output. I can create several clients, but I'm looking for concurrent operation.
How do I go about making multiple clients to communicate with each other? My vision - put the clients into separate threads and provide commands like 'wait for reply'.
Any advice is appreciated...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
全部在单个测试用例中的同一线程上完成。
注意:PacketListener 将在 Smack 内部生成的单独线程上调用,这就是为什么您需要 BlockingQueue 来协调发送和回复。
All done on same thread in a single testcase.
Note: The PacketListener will get called on a separate thread spawned internally by Smack, which is why you need the BlockingQueue to coordinate the send and the reply.