TCPController memServer2 = new TCPController();
memServer2.setHandler(new MockHandler("response from server2"));
memServer2.setCodecFactory(new TextLineCodecFactory());
memServer2.bind(new InetSocketAddress(4798));
MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil
.getAddressMap("localhost:4799,localhost:4798"));
// It must be in failure mode
builder.setFailureMode(true);
MemcachedClient client = builder.build();
client.setEnableHeartBeat(false);
try {
assertEquals("response from server1", client.get("a"));