@Override public void createBeforeMethod() throws Throwable { super.createBeforeMethod(); if (cleanupAfterMethod()) initMaps(); }
@Override @BeforeClass public void createBeforeClass() throws Throwable { super.createBeforeClass(); if (cleanupAfterTest()) initMaps(); }
@BeforeClass @Override public void createBeforeClass() throws Throwable { super.createBeforeClass(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder localBuilder = new ConfigurationBuilder(); configureCache(localBuilder); createClusteredCaches(numNodes, localBuilder); // Create distributed caches ConfigurationBuilder distBuilder = new ConfigurationBuilder(); distBuilder.clustering().cacheMode(isSync ? CacheMode.DIST_SYNC : CacheMode.DIST_ASYNC).hash().numOwners(numDistOwners); configureCache(distBuilder); cacheManagers.stream().forEach(cm -> cm.defineConfiguration(DIST, distBuilder.build())); // Create replicated caches ConfigurationBuilder replBuilder = new ConfigurationBuilder(); replBuilder.clustering().cacheMode(isSync ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC); configureCache(replBuilder); cacheManagers.stream().forEach(cm -> cm.defineConfiguration(REPL, replBuilder.build())); // Create scattered caches if (!Boolean.TRUE.equals(transactional)) { ConfigurationBuilder scatteredBuilder = new ConfigurationBuilder(); scatteredBuilder.clustering().cacheMode(CacheMode.SCATTERED_SYNC); if (biasAcquisition != null) { scatteredBuilder.clustering().biasAcquisition(biasAcquisition); } configureCache(scatteredBuilder); cacheManagers.stream().forEach(cm -> cm.defineConfiguration(SCATTERED, scatteredBuilder.build())); } // Wait for cluster to form waitForClusterToForm(DIST, REPL, SCATTERED); }
protected void initMaps() { fmapL1 = FunctionalMapImpl.create(getAdvancedCache(cacheManagers.get(0), null)); fmapL2 = FunctionalMapImpl.create(getAdvancedCache(cacheManagers.get(0), null)); fmapD1 = FunctionalMapImpl.create(getAdvancedCache(cacheManagers.get(0), DIST)); fmapD2 = FunctionalMapImpl.create(getAdvancedCache(cacheManagers.get(1), DIST)); fmapR1 = FunctionalMapImpl.create(getAdvancedCache(cacheManagers.get(0), REPL)); fmapR2 = FunctionalMapImpl.create(getAdvancedCache(cacheManagers.get(1), REPL)); fmapS1 = FunctionalMapImpl.create(getAdvancedCache(cacheManagers.get(0), SCATTERED)); fmapS2 = FunctionalMapImpl.create(getAdvancedCache(cacheManagers.get(1), SCATTERED)); }
@Override public Object[] factory() { return new Object[] { new FunctionalCachestoreTest().persistence(true).passivation(false), new FunctionalCachestoreTest().persistence(true).passivation(true) }; }
@Override protected void createCacheManagers() throws Throwable { super.createCacheManagers(); countingRequestRepositories = cacheManagers.stream().map(cm -> CountingRequestRepository.replaceDispatcher(cm)).collect(Collectors.toList()); Stream.of(null, DIST, REPL, SCATTERED).forEach(name -> caches(name).forEach(c -> { c.getAdvancedCache().getAsyncInterceptorChain().addInterceptorBefore(new CommandCachingInterceptor(), CallInterceptor.class); })); }
@Override @BeforeMethod public void createBeforeMethod() throws Throwable { super.createBeforeMethod(); this.ro = ReadOnlyMapImpl.create(fmapD1); this.sro = ReadOnlyMapImpl.create(fmapS1); this.lro = ReadOnlyMapImpl.create(fmapL1); this.wo = WriteOnlyMapImpl.create(fmapD1); this.rw = ReadWriteMapImpl.create(fmapD1); this.cache = cacheManagers.get(0).<Object, String>getCache(DIST).getAdvancedCache(); this.swo = WriteOnlyMapImpl.create(fmapS1); this.srw = ReadWriteMapImpl.create(fmapS1); this.scatteredCache = cacheManagers.get(0).<Object, String>getCache(SCATTERED).getAdvancedCache(); this.lwo = WriteOnlyMapImpl.create(fmapL1); this.lrw = ReadWriteMapImpl.create(fmapL1); }
@BeforeClass @Override public void createBeforeClass() throws Throwable { super.createBeforeClass(); local1 = FunctionalJCache.create(fmapL1); local2 = FunctionalJCache.create(fmapL2); dist1 = FunctionalJCache.create(fmapD1); dist2 = FunctionalJCache.create(fmapD2); repl1 = FunctionalJCache.create(fmapR1); repl2 = FunctionalJCache.create(fmapR2); }
@BeforeClass @Override public void createBeforeClass() throws Throwable { super.createBeforeClass(); local1 = FunctionalConcurrentMap.create(cacheManagers.get(0).<Integer, String>getCache().getAdvancedCache()); local2 = FunctionalConcurrentMap.create(cacheManagers.get(0).<Integer, String>getCache().getAdvancedCache()); dist1 = FunctionalConcurrentMap.create(cacheManagers.get(0).<Object, String>getCache(DIST).getAdvancedCache()); dist2 = FunctionalConcurrentMap.create(cacheManagers.get(1).<Object, String>getCache(DIST).getAdvancedCache()); repl1 = FunctionalConcurrentMap.create(cacheManagers.get(0).<Object, String>getCache(REPL).getAdvancedCache()); repl2 = FunctionalConcurrentMap.create(cacheManagers.get(1).<Object, String>getCache(REPL).getAdvancedCache()); }