@Override protected void createCacheManagers() throws Throwable { GlobalConfigurationBuilder globalCfg1 = createForeignExternalizerGlobalConfig(); GlobalConfigurationBuilder globalCfg2 = createForeignExternalizerGlobalConfig(); ConfigurationBuilder cfg = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false); CacheContainer cm1 = TestCacheManagerFactory.createClusteredCacheManager(globalCfg1, cfg); CacheContainer cm2 = TestCacheManagerFactory.createClusteredCacheManager(globalCfg2, cfg); registerCacheManager(cm1, cm2); defineConfigurationOnAllManagers(getCacheName(), cfg); waitForClusterToForm(getCacheName()); }
public void testReplicatePojosWithUserDefinedExternalizers(Method m) { Cache cache1 = manager(0).getCache(getCacheName()); Cache cache2 = manager(1).getCache(getCacheName()); IdViaConfigObj configObj = new IdViaConfigObj().setName("Galder"); String key = "k-" + m.getName() + "-viaConfig"; cache1.put(key, configObj); assert configObj.name.equals(((IdViaConfigObj)cache2.get(key)).name); IdViaAnnotationObj annotationObj = new IdViaAnnotationObj().setDate(new Date(System.currentTimeMillis())); key = "k-" + m.getName() + "-viaAnnotation"; cache1.put(key, annotationObj); assert annotationObj.date.equals(((IdViaAnnotationObj)cache2.get(key)).date); IdViaBothObj bothObj = new IdViaBothObj().setAge(30); key = "k-" + m.getName() + "-viaBoth"; cache1.put(key, bothObj); assert bothObj.age == ((IdViaBothObj)cache2.get(key)).age; }