Search in sources :

Example 41 with RegionCreation

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

the class CacheXml66DUnitTest method testREPLICATE_PROXY.

@Test
public void testREPLICATE_PROXY() throws Exception {
    CacheCreation cache = new CacheCreation();
    RegionCreation root = (RegionCreation) cache.createRegion("replicateProxy", "REPLICATE_PROXY");
    testXml(cache);
    GemFireCacheImpl c = (GemFireCacheImpl) getCache();
    Region r = c.getRegion("replicateProxy");
    assertNotNull(r);
    RegionAttributes ra = r.getAttributes();
    assertEquals(DataPolicy.EMPTY, ra.getDataPolicy());
    assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
}
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) RegionCreation(org.apache.geode.internal.cache.xmlcache.RegionCreation) Test(org.junit.Test)

Example 42 with RegionCreation

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

the class CacheXml66DUnitTest method testPARTITION.

@Test
public void testPARTITION() throws Exception {
    CacheCreation cache = new CacheCreation();
    RegionCreation root = (RegionCreation) cache.createRegion("partition", "PARTITION");
    testXml(cache);
    GemFireCacheImpl c = (GemFireCacheImpl) getCache();
    Region r = c.getRegion("partition");
    assertNotNull(r);
    RegionAttributes ra = r.getAttributes();
    assertEquals(DataPolicy.PARTITION, ra.getDataPolicy());
    assertNotNull(ra.getPartitionAttributes());
    assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
}
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) RegionCreation(org.apache.geode.internal.cache.xmlcache.RegionCreation) Test(org.junit.Test)

Example 43 with RegionCreation

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

the class CacheXml66DUnitTest method testREPLICATE.

@Test
public void testREPLICATE() throws Exception {
    CacheCreation cache = new CacheCreation();
    RegionCreation root = (RegionCreation) cache.createRegion("replicate", "REPLICATE");
    testXml(cache);
    GemFireCacheImpl c = (GemFireCacheImpl) getCache();
    Region r = c.getRegion("replicate");
    assertNotNull(r);
    RegionAttributes ra = r.getAttributes();
    assertEquals(DataPolicy.REPLICATE, ra.getDataPolicy());
    assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
}
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) RegionCreation(org.apache.geode.internal.cache.xmlcache.RegionCreation) Test(org.junit.Test)

Example 44 with RegionCreation

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

the class CacheXml66DUnitTest method testPARTITION_REDUNDANT_HEAP_LRU.

@Test
public void testPARTITION_REDUNDANT_HEAP_LRU() throws Exception {
    CacheCreation cache = new CacheCreation();
    RegionCreation root = (RegionCreation) cache.createRegion("rpartitionlru", "PARTITION_REDUNDANT_HEAP_LRU");
    testXml(cache);
    GemFireCacheImpl c = (GemFireCacheImpl) getCache();
    Region r = c.getRegion("rpartitionlru");
    assertNotNull(r);
    RegionAttributes ra = r.getAttributes();
    assertEquals(DataPolicy.PARTITION, ra.getDataPolicy());
    assertNotNull(ra.getPartitionAttributes());
    assertEquals(1, ra.getPartitionAttributes().getRedundantCopies());
    assertEquals(EvictionAttributes.createLRUHeapAttributes(), ra.getEvictionAttributes());
    assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE, c.getResourceManager().getEvictionHeapPercentage(), 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) RegionCreation(org.apache.geode.internal.cache.xmlcache.RegionCreation) Test(org.junit.Test)

Example 45 with RegionCreation

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

the class CacheXml66DUnitTest method testPARTITION_REDUNDANT.

@Test
public void testPARTITION_REDUNDANT() throws Exception {
    CacheCreation cache = new CacheCreation();
    RegionCreation root = (RegionCreation) cache.createRegion("rpartition", "PARTITION_REDUNDANT");
    testXml(cache);
    GemFireCacheImpl c = (GemFireCacheImpl) getCache();
    Region r = c.getRegion("rpartition");
    assertNotNull(r);
    RegionAttributes ra = r.getAttributes();
    assertEquals(DataPolicy.PARTITION, ra.getDataPolicy());
    assertNotNull(ra.getPartitionAttributes());
    assertEquals(1, ra.getPartitionAttributes().getRedundantCopies());
}
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) RegionCreation(org.apache.geode.internal.cache.xmlcache.RegionCreation) Test(org.junit.Test)

Aggregations

RegionCreation (org.apache.geode.internal.cache.xmlcache.RegionCreation)47 Test (org.junit.Test)44 ClientCacheCreation (org.apache.geode.internal.cache.xmlcache.ClientCacheCreation)42 Region (org.apache.geode.cache.Region)35 RegionAttributes (org.apache.geode.cache.RegionAttributes)35 DistributedRegion (org.apache.geode.internal.cache.DistributedRegion)35 LocalRegion (org.apache.geode.internal.cache.LocalRegion)35 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)35 CacheCreation (org.apache.geode.internal.cache.xmlcache.CacheCreation)35 GemFireCacheImpl (org.apache.geode.internal.cache.GemFireCacheImpl)32 RegionAttributesCreation (org.apache.geode.internal.cache.xmlcache.RegionAttributesCreation)11 DiskWriteAttributesFactory (org.apache.geode.cache.DiskWriteAttributesFactory)6 DiskStore (org.apache.geode.cache.DiskStore)4 DiskStoreFactory (org.apache.geode.cache.DiskStoreFactory)4 File (java.io.File)3 AttributesFactory (org.apache.geode.cache.AttributesFactory)3 PartitionAttributesFactory (org.apache.geode.cache.PartitionAttributesFactory)3 ResourceManagerCreation (org.apache.geode.internal.cache.xmlcache.ResourceManagerCreation)3 HashMap (java.util.HashMap)2 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)2