Search in sources :

Example 6 with ResourceManagerCreation

use of org.apache.geode.internal.cache.xmlcache.ResourceManagerCreation in project geode by apache.

the class CacheXml66DUnitTest method testPARTITION_OVERFLOW.

@Test
public void testPARTITION_OVERFLOW() throws Exception {
    CacheCreation cache = new CacheCreation();
    ResourceManagerCreation rmc = new ResourceManagerCreation();
    rmc.setEvictionHeapPercentage(55.0f);
    rmc.setCriticalHeapPercentage(80.0f);
    cache.setResourceManagerCreation(rmc);
    RegionCreation root = (RegionCreation) cache.createRegion("partitionoverflow", "PARTITION_OVERFLOW");
    testXml(cache);
    GemFireCacheImpl c = (GemFireCacheImpl) getCache();
    Region r = c.getRegion("partitionoverflow");
    assertNotNull(r);
    RegionAttributes ra = r.getAttributes();
    assertEquals(DataPolicy.PARTITION, ra.getDataPolicy());
    assertNotNull(ra.getPartitionAttributes());
    assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
    assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes());
    assertEquals(55.0f, c.getResourceManager().getEvictionHeapPercentage(), 0);
    assertEquals(80.0f, c.getResourceManager().getCriticalHeapPercentage(), 0);
}
Also used : RegionAttributes(org.apache.geode.cache.RegionAttributes) GemFireCacheImpl(org.apache.geode.internal.cache.GemFireCacheImpl) LocalRegion(org.apache.geode.internal.cache.LocalRegion) PartitionedRegion(org.apache.geode.internal.cache.PartitionedRegion) Region(org.apache.geode.cache.Region) DistributedRegion(org.apache.geode.internal.cache.DistributedRegion) CacheCreation(org.apache.geode.internal.cache.xmlcache.CacheCreation) ClientCacheCreation(org.apache.geode.internal.cache.xmlcache.ClientCacheCreation) ResourceManagerCreation(org.apache.geode.internal.cache.xmlcache.ResourceManagerCreation) RegionCreation(org.apache.geode.internal.cache.xmlcache.RegionCreation) Test(org.junit.Test)

Aggregations

CacheCreation (org.apache.geode.internal.cache.xmlcache.CacheCreation)6 ResourceManagerCreation (org.apache.geode.internal.cache.xmlcache.ResourceManagerCreation)6 Test (org.junit.Test)6 ClientCacheCreation (org.apache.geode.internal.cache.xmlcache.ClientCacheCreation)5 Region (org.apache.geode.cache.Region)4 RegionAttributes (org.apache.geode.cache.RegionAttributes)4 DistributedRegion (org.apache.geode.internal.cache.DistributedRegion)4 LocalRegion (org.apache.geode.internal.cache.LocalRegion)4 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)4 Cache (org.apache.geode.cache.Cache)3 GemFireCacheImpl (org.apache.geode.internal.cache.GemFireCacheImpl)3 RegionCreation (org.apache.geode.internal.cache.xmlcache.RegionCreation)3 ClientCache (org.apache.geode.cache.client.ClientCache)2 IgnoredException (org.apache.geode.test.dunit.IgnoredException)2 Properties (java.util.Properties)1 AttributesFactory (org.apache.geode.cache.AttributesFactory)1 DiskWriteAttributesFactory (org.apache.geode.cache.DiskWriteAttributesFactory)1 EvictionAttributes (org.apache.geode.cache.EvictionAttributes)1 ExpirationAttributes (org.apache.geode.cache.ExpirationAttributes)1 FixedPartitionAttributes (org.apache.geode.cache.FixedPartitionAttributes)1