0

Has anyone tried to use Awaitility to test a Netty Client and Server.

I want to test that the server has received all messages from the Client and any other tests that might be useful.

I suppose the only thing is how to get the number of messages the Server received from the Server side Handler

4

1 回答 1

1

我从不使用“Awaitility”来测试netty,但是编写这样的测试真的很简单。只需添加一个自定义 SimpleChannelUpstreamHandler ,它会在每个 messageReceived(..) 调用上增加一个计数器,然后检查计数是否与您对 junit assertEquals(..) 的期望匹配

于 2012-01-11T18:10:28.827 回答