Search in sources :

Example 6 with MemcacheProtocolConfig

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();
    }
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) MemcacheProtocolConfig(com.hazelcast.config.MemcacheProtocolConfig) MemcacheProtocolConfig(com.hazelcast.config.MemcacheProtocolConfig) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

MemcacheProtocolConfig (com.hazelcast.config.MemcacheProtocolConfig)6 QuickTest (com.hazelcast.test.annotation.QuickTest)4 Test (org.junit.Test)4 Config (com.hazelcast.config.Config)3 HazelcastInstance (com.hazelcast.core.HazelcastInstance)3 AdvancedNetworkConfig (com.hazelcast.config.AdvancedNetworkConfig)1 RestApiConfig (com.hazelcast.config.RestApiConfig)1 StringUtil.bytesToString (com.hazelcast.internal.util.StringUtil.bytesToString)1