use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testCACHING_PROXY_OVERFLOW.
@Test
public void testCACHING_PROXY_OVERFLOW() throws Exception {
ClientCacheCreation cache = new ClientCacheCreation();
RegionCreation root = (RegionCreation) cache.createRegion("cproxyoverflow", "CACHING_PROXY_OVERFLOW");
testXml(cache);
GemFireCacheImpl c = (GemFireCacheImpl) getCache();
assertEquals(true, c.isClient());
Region r = c.getRegion("cproxyoverflow");
assertNotNull(r);
RegionAttributes ra = r.getAttributes();
assertEquals(DataPolicy.NORMAL, ra.getDataPolicy());
assertEquals(Scope.LOCAL, ra.getScope());
assertEquals("DEFAULT", ra.getPoolName());
assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE, c.getResourceManager().getEvictionHeapPercentage(), 0);
}
use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testPROXY.
@Test
public void testPROXY() throws Exception {
ClientCacheCreation cache = new ClientCacheCreation();
RegionCreation root = (RegionCreation) cache.createRegion("proxy", "PROXY");
testXml(cache);
GemFireCacheImpl c = (GemFireCacheImpl) getCache();
assertEquals(true, c.isClient());
Region r = c.getRegion("proxy");
assertNotNull(r);
RegionAttributes ra = r.getAttributes();
assertEquals(DataPolicy.EMPTY, ra.getDataPolicy());
assertEquals(Scope.LOCAL, ra.getScope());
assertEquals("DEFAULT", ra.getPoolName());
}
use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testREPLICATE_PERSISTENT_OVERFLOW.
@Test
public void testREPLICATE_PERSISTENT_OVERFLOW() throws Exception {
CacheCreation cache = new CacheCreation();
RegionCreation root = (RegionCreation) cache.createRegion("preplicateoverflow", "REPLICATE_PERSISTENT_OVERFLOW");
testXml(cache);
GemFireCacheImpl c = (GemFireCacheImpl) getCache();
Region r = c.getRegion("preplicateoverflow");
assertNotNull(r);
RegionAttributes ra = r.getAttributes();
assertEquals(DataPolicy.PERSISTENT_REPLICATE, ra.getDataPolicy());
assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE, c.getResourceManager().getEvictionHeapPercentage(), 0);
}
use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testDiskStoreFactory.
@Test
public void testDiskStoreFactory() throws Exception {
CacheCreation cache = new CacheCreation();
DiskStoreFactory dsf = cache.createDiskStoreFactory();
dsf.setDiskDirs(new File[] { new File("non_exist_dir") });
DiskStore ds1 = dsf.create(getUniqueName());
dsf.setDiskDirs(new File[] { new File(".") });
ds1 = dsf.create(getUniqueName());
RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
attrs.setScope(Scope.DISTRIBUTED_ACK);
attrs.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
attrs.setDiskStoreName(getUniqueName());
AttributesFactory factory = new AttributesFactory(attrs);
RegionAttributes ra = factory.create();
RegionCreation root = (RegionCreation) cache.createRegion("root", ra);
factory = new AttributesFactory();
factory.setDiskStoreName(getUniqueName());
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
ra = factory.create();
RegionCreation root2 = (RegionCreation) cache.createRegion("root2", ra);
factory = new AttributesFactory();
factory.setDiskStoreName(null);
factory.setScope(Scope.DISTRIBUTED_ACK);
factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
ra = factory.create();
RegionCreation root3 = (RegionCreation) cache.createRegion("root3", ra);
testXml(cache);
}
use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testPARTITION_PERSISTENT.
@Test
public void testPARTITION_PERSISTENT() throws Exception {
CacheCreation cache = new CacheCreation();
RegionCreation root = (RegionCreation) cache.createRegion("ppartition", "PARTITION_PERSISTENT");
testXml(cache);
GemFireCacheImpl c = (GemFireCacheImpl) getCache();
Region r = c.getRegion("ppartition");
assertNotNull(r);
RegionAttributes ra = r.getAttributes();
assertEquals(DataPolicy.PERSISTENT_PARTITION, ra.getDataPolicy());
assertNotNull(ra.getPartitionAttributes());
assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
}
Aggregations