示例#1
0
 private void testSender(int count) {
   ArrayList<String> expected = new ArrayList<String>(count);
   for (int i = 0; i < count; i++) {
     expected.add(template.render(i));
   }
   server.setMaxConnections(1);
   Sender snd = Sender.Builder().withTarget(server.address()).create();
   reactor.getHandler().add(snd);
   snd.start(reactor);
   for (String msg : expected) {
     snd.send(msg);
   }
   snd.close();
   reactor.run();
   assertEquals("messages received", expected, sink.getMessages());
 }