for (int i = 0; i < 500; i++) {
byte[] key = generateKey(i);
keys.add(key);
String keyStr = new String(key);
remoteCache.put(keyStr, "value");
TcpTransport transport = (TcpTransport) tcpConnectionFactory.getTransport(marshall(keyStr), null);
assertHotRodEquals(hrServ2CacheManager.get(transport.getServerAddress()), keyStr, "value");
tcpConnectionFactory.releaseTransport(transport);
}
log.info("Right before first get.");
for (byte[] key : keys) {
resetStats();
String keyStr = new String(key);
assert remoteCache.get(keyStr).equals("value");
TcpTransport transport = (TcpTransport) tcpConnectionFactory.getTransport(marshall(keyStr), null);
assertOnlyServerHit(transport.getServerAddress());
tcpConnectionFactory.releaseTransport(transport);
}
}