use of org.infinispan.marshall.core.impl.DelegatingUserMarshaller in project infinispan by infinispan.
the class ProtostreamUserMarshallerTest method testProtostreamMarshallerLoaded.
public void testProtostreamMarshallerLoaded() {
PersistenceMarshaller pm = TestingUtil.extractPersistenceMarshaller(manager(0));
testIsMarshallableAndPut(pm, new ExampleUserPojo("A Pojo!"), new AnotherExampleUserPojo("And another one!"));
DelegatingUserMarshaller userMarshaller = (DelegatingUserMarshaller) pm.getUserMarshaller();
assertTrue(userMarshaller.getDelegate() instanceof ImmutableProtoStreamMarshaller);
}
use of org.infinispan.marshall.core.impl.DelegatingUserMarshaller in project infinispan by infinispan.
the class MultimapStoreBucketTest method testMultimapWithJavaSerializationMarshaller.
public void testMultimapWithJavaSerializationMarshaller() throws Exception {
GlobalConfigurationBuilder globalBuilder = new GlobalConfigurationBuilder().nonClusteredDefault();
globalBuilder.defaultCacheName("test");
globalBuilder.serialization().marshaller(new JavaSerializationMarshaller()).allowList().addClass(SuperPerson.class.getName());
ConfigurationBuilder config = new ConfigurationBuilder();
config.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class);
EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(globalBuilder, config);
MultimapCacheManager<String, Person> multimapCacheManager = EmbeddedMultimapCacheManagerFactory.from(cm);
MultimapCache<String, Person> multimapCache = multimapCacheManager.get("test");
multimapCache.put("k1", new SuperPerson());
PersistenceMarshallerImpl pm = TestingUtil.extractPersistenceMarshaller(cm);
DelegatingUserMarshaller userMarshaller = (DelegatingUserMarshaller) pm.getUserMarshaller();
assertTrue(userMarshaller.getDelegate() instanceof JavaSerializationMarshaller);
assertTrue(pm.getSerializationContext().canMarshall(Bucket.class));
assertTrue(multimapCache.containsKey("k1").get(1, TimeUnit.SECONDS));
}
use of org.infinispan.marshall.core.impl.DelegatingUserMarshaller in project infinispan by infinispan.
the class MigratorConfigurationTest method testCustomMarshallerLoaded.
public void testCustomMarshallerLoaded() {
Properties properties = createBaseProperties();
properties.put(propKey(SOURCE, MARSHALLER, CLASS), GenericJBossMarshaller.class.getName());
StoreProperties props = new StoreProperties(SOURCE, properties);
Marshaller marshaller = SerializationConfigUtil.getMarshaller(props);
assertNotNull(marshaller);
assertTrue(marshaller instanceof PersistenceMarshaller);
PersistenceMarshaller pm = (PersistenceMarshaller) marshaller;
DelegatingUserMarshaller userMarshaller = (DelegatingUserMarshaller) pm.getUserMarshaller();
AssertJUnit.assertTrue(userMarshaller.getDelegate() instanceof GenericJBossMarshaller);
}
Aggregations