use of com.hazelcast.config.MemcacheProtocolConfig in project hazelcast by hazelcast.
the class MemcacheProtocolFilterTest method testVersionCommandWithMemcacheEnabled.
/**
* <pre>
* Given: Memcache protocol is explicitly enabled
* When: version command is used
* Then: correct response is provided
* </pre>
*/
@Test
public void testVersionCommandWithMemcacheEnabled() throws Exception {
Config config = new Config();
config.getNetworkConfig().setMemcacheProtocolConfig(new MemcacheProtocolConfig().setEnabled(true));
HazelcastInstance hz = factory.newHazelcastInstance(config);
TextProtocolClient client = new TextProtocolClient(getAddress(hz).getInetSocketAddress());
try {
client.connect();
client.sendData("version\n");
assertTrueEventually(createResponseAssertTask("Version expected", client, "VERSION Hazelcast"), 10);
} finally {
client.close();
}
}
Aggregations