Search in sources :

Example 6 with GlobalSerializerConfig

use of com.hazelcast.config.GlobalSerializerConfig in project hazelcast by hazelcast.

the class TestFullApplicationContext method testSerializationConfig.

@Test
public void testSerializationConfig() {
    SerializationConfig serializationConfig = config.getSerializationConfig();
    assertEquals(ByteOrder.BIG_ENDIAN, serializationConfig.getByteOrder());
    assertEquals(false, serializationConfig.isCheckClassDefErrors());
    assertEquals(13, serializationConfig.getPortableVersion());
    Map<Integer, String> dataSerializableFactoryClasses = serializationConfig.getDataSerializableFactoryClasses();
    assertFalse(dataSerializableFactoryClasses.isEmpty());
    assertEquals(DummyDataSerializableFactory.class.getName(), dataSerializableFactoryClasses.get(1));
    Map<Integer, DataSerializableFactory> dataSerializableFactories = serializationConfig.getDataSerializableFactories();
    assertFalse(dataSerializableFactories.isEmpty());
    assertEquals(DummyDataSerializableFactory.class, dataSerializableFactories.get(2).getClass());
    Map<Integer, String> portableFactoryClasses = serializationConfig.getPortableFactoryClasses();
    assertFalse(portableFactoryClasses.isEmpty());
    assertEquals(DummyPortableFactory.class.getName(), portableFactoryClasses.get(1));
    Map<Integer, PortableFactory> portableFactories = serializationConfig.getPortableFactories();
    assertFalse(portableFactories.isEmpty());
    assertEquals(DummyPortableFactory.class, portableFactories.get(2).getClass());
    Collection<SerializerConfig> serializerConfigs = serializationConfig.getSerializerConfigs();
    assertFalse(serializerConfigs.isEmpty());
    GlobalSerializerConfig globalSerializerConfig = serializationConfig.getGlobalSerializerConfig();
    assertNotNull(globalSerializerConfig);
    assertEquals(dummySerializer, globalSerializerConfig.getImplementation());
}
Also used : SerializationConfig(com.hazelcast.config.SerializationConfig) GlobalSerializerConfig(com.hazelcast.config.GlobalSerializerConfig) SerializerConfig(com.hazelcast.config.SerializerConfig) GlobalSerializerConfig(com.hazelcast.config.GlobalSerializerConfig) DataSerializableFactory(com.hazelcast.nio.serialization.DataSerializableFactory) DummyDataSerializableFactory(com.hazelcast.spring.serialization.DummyDataSerializableFactory) DummyPortableFactory(com.hazelcast.spring.serialization.DummyPortableFactory) DummyDataSerializableFactory(com.hazelcast.spring.serialization.DummyDataSerializableFactory) DummyPortableFactory(com.hazelcast.spring.serialization.DummyPortableFactory) PortableFactory(com.hazelcast.nio.serialization.PortableFactory) Test(org.junit.Test) QuickTest(com.hazelcast.test.annotation.QuickTest)

Aggregations

GlobalSerializerConfig (com.hazelcast.config.GlobalSerializerConfig)6 QuickTest (com.hazelcast.test.annotation.QuickTest)5 Test (org.junit.Test)5 SerializationConfig (com.hazelcast.config.SerializationConfig)4 ObjectDataInput (com.hazelcast.nio.ObjectDataInput)3 ObjectDataOutput (com.hazelcast.nio.ObjectDataOutput)3 SerializerConfig (com.hazelcast.config.SerializerConfig)2 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)2 HeapData (com.hazelcast.internal.serialization.impl.HeapData)2 SerializationService (com.hazelcast.spi.serialization.SerializationService)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Config (com.hazelcast.config.Config)1 NearCacheConfig (com.hazelcast.config.NearCacheConfig)1 XMLConfigBuilderTest (com.hazelcast.config.XMLConfigBuilderTest)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 HazelcastInstanceAware (com.hazelcast.core.HazelcastInstanceAware)1 InputOutputFactory (com.hazelcast.internal.serialization.InputOutputFactory)1 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)1 JavaSerializer (com.hazelcast.internal.serialization.impl.JavaDefaultSerializers.JavaSerializer)1 DataSerializableFactory (com.hazelcast.nio.serialization.DataSerializableFactory)1