Search in sources :

Example 1 with PersonCacheEntryListenerConfiguration

use of classloading.domain.PersonCacheEntryListenerConfiguration in project hazelcast by hazelcast.

the class PreJoinCacheConfigTest method serializationSucceeds_cacheListeners.

@Test
public void serializationSucceeds_cacheListeners() {
    CacheConfig<String, Person> cacheConfig = newDefaultCacheConfig("test");
    cacheConfig.getListenerConfigurations().add(new PersonCacheEntryListenerConfiguration());
    PreJoinCacheConfig preJoinCacheConfig = new PreJoinCacheConfig(cacheConfig);
    Data data = serializationService.toData(preJoinCacheConfig);
    PreJoinCacheConfig deserialized = serializationService.toObject(data);
    assertEquals(preJoinCacheConfig, deserialized);
    assertEquals(cacheConfig, deserialized.asCacheConfig());
    assertNull(deserialized.getCacheWriterFactory());
    assertEquals(1, deserialized.getListenerConfigurations().size());
    assertTrue("Invalid Factory Class", deserialized.getCacheEntryListenerConfigurations().iterator().next() instanceof PersonCacheEntryListenerConfiguration);
}
Also used : PersonCacheEntryListenerConfiguration(classloading.domain.PersonCacheEntryListenerConfiguration) Data(com.hazelcast.internal.serialization.Data) Person(classloading.domain.Person) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) CacheConfigTest(com.hazelcast.config.CacheConfigTest) Test(org.junit.Test)

Aggregations

Person (classloading.domain.Person)1 PersonCacheEntryListenerConfiguration (classloading.domain.PersonCacheEntryListenerConfiguration)1 CacheConfigTest (com.hazelcast.config.CacheConfigTest)1 Data (com.hazelcast.internal.serialization.Data)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1