use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class WanConsumerConfigTest method testSerialization.
@Test
public void testSerialization() {
Map<String, Comparable> properties = new HashMap<String, Comparable>();
properties.put("key", "value");
config.setProperties(properties);
config.setClassName("className");
config.setImplementation("implementation");
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
Data serialized = serializationService.toData(config);
WanConsumerConfig deserialized = serializationService.toObject(serialized);
assertWanConsumerConfig(config, deserialized);
}
use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class WanReplicationConfigTest method testSerialization_withEmpyConfigs.
@Test
public void testSerialization_withEmpyConfigs() {
config.setName("name");
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
Data serialized = serializationService.toData(config);
WanReplicationConfig deserialized = serializationService.toObject(serialized);
assertWanReplicationConfig(config, deserialized);
}
use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class WanReplicationRefTest method testSerialization.
@Test
public void testSerialization() {
ref.setName("myWanReplicationRef");
ref.setMergePolicy("myMergePolicy");
ref.setRepublishingEnabled(true);
ref.addFilter("myFilter");
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
Data serialized = serializationService.toData(ref);
WanReplicationRef deserialized = serializationService.toObject(serialized);
assertEquals(ref.getName(), deserialized.getName());
assertEquals(ref.getMergePolicy(), deserialized.getMergePolicy());
assertEquals(ref.isRepublishingEnabled(), deserialized.isRepublishingEnabled());
assertEquals(ref.getFilters(), deserialized.getFilters());
assertEquals(ref.toString(), deserialized.toString());
}
use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class NearCacheConfigTest method testSerialization.
@Test
public void testSerialization() {
config.setInvalidateOnChange(true);
config.setCacheLocalEntries(true);
config.setName("foobar");
config.setInMemoryFormat(InMemoryFormat.NATIVE);
config.setTimeToLiveSeconds(23);
config.setMaxIdleSeconds(42);
config.setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy.CACHE_ON_UPDATE);
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
Data serialized = serializationService.toData(config);
NearCacheConfig deserialized = serializationService.toObject(serialized);
assertEquals(config.isInvalidateOnChange(), deserialized.isInvalidateOnChange());
assertEquals(config.isCacheLocalEntries(), deserialized.isCacheLocalEntries());
assertEquals(config.getName(), deserialized.getName());
assertEquals(config.getInMemoryFormat(), deserialized.getInMemoryFormat());
assertEquals(config.getTimeToLiveSeconds(), deserialized.getTimeToLiveSeconds());
assertEquals(config.getMaxIdleSeconds(), deserialized.getMaxIdleSeconds());
assertEquals(config.getLocalUpdatePolicy(), deserialized.getLocalUpdatePolicy());
assertEquals(config.getEvictionPolicy(), deserialized.getEvictionPolicy());
assertEquals(config.getMaxSize(), deserialized.getMaxSize());
assertEquals(config.toString(), deserialized.toString());
}
use of com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder in project hazelcast by hazelcast.
the class NearCachePreloaderConfigTest method testSerialization.
@Test
public void testSerialization() {
config.setEnabled(true);
config.setDirectory("myParentDirectory");
config.setStoreInitialDelaySeconds(23);
config.setStoreIntervalSeconds(42);
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
Data serialized = serializationService.toData(config);
NearCachePreloaderConfig deserialized = serializationService.toObject(serialized);
assertEquals(config.isEnabled(), deserialized.isEnabled());
assertEquals(config.getDirectory(), deserialized.getDirectory());
assertEquals(config.getStoreInitialDelaySeconds(), deserialized.getStoreInitialDelaySeconds());
assertEquals(config.getStoreIntervalSeconds(), deserialized.getStoreIntervalSeconds());
assertEquals(config.toString(), deserialized.toString());
}
Aggregations