use of biz.xsoftware.mock.CalledMethod in project webpieces by deanhiller.
the class TestDatagramChannel method verifyPacket.
/**
* @param clientAddr
* @param localHost
* @param payload
*/
private void verifyPacket(InetSocketAddress clientAddr, InetAddress localHost, String payload) {
CalledMethod m = svrHandler.expect("incomingData");
InetSocketAddress remoteAddr = (InetSocketAddress) m.getAllParams()[1];
ByteBuffer buf1 = (ByteBuffer) m.getAllParams()[2];
assertEquals(localHost, remoteAddr.getAddress());
assertEquals(clientAddr.getPort(), remoteAddr.getPort());
String actual = HELPER.readString(buf1, buf1.remaining());
//log.info("payload='"+payload+"' act='"+actual+"'");
assertEquals(payload, actual);
}
Aggregations