Search in sources :

Example 1 with PortableFactory

use of com.hazelcast.client.test.PortableFactory in project hazelcast by hazelcast.

the class ClientConfigTest method testAccessSerializationConfigOverClientInstance.

@Test
public void testAccessSerializationConfigOverClientInstance() {
    hazelcastFactory.newHazelcastInstance();
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.getSerializationConfig().addPortableFactory(PortableFactory.FACTORY_ID, new PortableFactory());
    HazelcastInstance client = hazelcastFactory.newHazelcastClient(clientConfig);
    SerializationConfig serializationConfig = client.getConfig().getSerializationConfig();
    Map<Integer, com.hazelcast.nio.serialization.PortableFactory> factories = serializationConfig.getPortableFactories();
    assertEquals(1, factories.size());
    assertEquals(factories.get(PortableFactory.FACTORY_ID).create(Employee.CLASS_ID).getClassId(), Employee.CLASS_ID);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) SerializationConfig(com.hazelcast.config.SerializationConfig) PortableFactory(com.hazelcast.client.test.PortableFactory) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

PortableFactory (com.hazelcast.client.test.PortableFactory)1 SerializationConfig (com.hazelcast.config.SerializationConfig)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1