use of com.hazelcast.internal.serialization.SerializationService in project hazelcast by hazelcast.
the class WanCustomPublisherConfigTest method testSerialization.
@Test
public void testSerialization() {
Map<String, Comparable> properties = new HashMap<>();
properties.put("key1", "value1");
properties.put("key2", "value2");
WanCustomPublisherConfig config = new WanCustomPublisherConfig().setPublisherId("myPublisherId").setClassName("className").setProperties(properties).setImplementation(new DummyWanPublisher());
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
Data serialized = serializationService.toData(config);
WanCustomPublisherConfig deserialized = serializationService.toObject(serialized);
assertWanPublisherConfig(config, deserialized);
}
use of com.hazelcast.internal.serialization.SerializationService 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(new DummyWanConsumer());
config.setPersistWanReplicatedData(false);
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
Data serialized = serializationService.toData(config);
WanConsumerConfig deserialized = serializationService.toObject(serialized);
assertWanConsumerConfig(config, deserialized);
}
use of com.hazelcast.internal.serialization.SerializationService 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.SerializationService in project hazelcast by hazelcast.
the class RingbufferStoreConfigTest method setStoreImplementation.
@Test
public void setStoreImplementation() {
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
RingbufferStore<Data> store = RingbufferStoreWrapper.create(RingbufferService.getRingbufferNamespace("name"), config, OBJECT, serializationService, null);
config.setStoreImplementation(store);
assertEquals(store, config.getStoreImplementation());
}
use of com.hazelcast.internal.serialization.SerializationService 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.toString(), deserialized.toString());
}
Aggregations