private long evictionWaitTime = 2100;
@BeforeMethod
public void setUp() throws Exception
{
c1 = (CacheSPI) new DefaultCacheFactory().createCache(false);
// the FIFO policy cfg
FIFOConfiguration cfg = new FIFOConfiguration();
cfg.setMaxNodes(1);
cfg.setMinTimeToLiveSeconds(0);
// the region configuration
EvictionRegionConfig regionCfg = new EvictionRegionConfig();
regionCfg.setRegionFqn(dummy.getParent());
regionCfg.setRegionName(dummy.getParent().toString());
regionCfg.setEvictionPolicyConfig(cfg);
// set regions in a list
List<EvictionRegionConfig> evictionRegionConfigs = new ArrayList<EvictionRegionConfig>();
evictionRegionConfigs.add(regionCfg);
EvictionConfig ec = new EvictionConfig();
ec.setWakeupIntervalSeconds(1);
ec.setEvictionRegionConfigs(evictionRegionConfigs);
c1.getConfiguration().setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
c1.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
c1.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
c1.getConfiguration().setEvictionConfig(ec);
c2 = (CacheSPI) new DefaultCacheFactory().createCache(c1.getConfiguration().clone(), false);
c1.start();
c2.start();
TestingUtil.blockUntilViewsReceived(60000, c1, c2);