public Region createVMRegion(String name, RegionAttributes attrs) throws RegionExistsException, TimeoutException { return createRegion(name, attrs); } public Region createRegion(String name, RegionAttributes attrs) throws RegionExistsException, TimeoutException {
public Region createVMRegion(String name, RegionAttributes attrs) throws RegionExistsException, TimeoutException { return createRegion(name, attrs); } public Region createRegion(String name, RegionAttributes attrs) throws RegionExistsException, TimeoutException {
/** * Tests creating a cache whose keys are constrained */ public void testConstrainedKeys() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setKeyConstraint(String.class); cache.createRegion("root", attrs); testXml(cache); }
/** * Tests a cache listener with no parameters */ public void testCacheListener() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); CacheListener listener = new MyTestCacheListener(); attrs.setCacheListener(listener); cache.createRegion("root", attrs); testXml(cache); }
/** * Tests the <code>overflowThreshold</code> and * <code>persistBackup</code> related attributes */ public void testOverflowAndBackup() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setMirrorType(MirrorType.KEYS_VALUES); attrs.setPersistBackup(true); cache.createRegion("root", attrs); testXml(cache); }
/** * Tests a cache writer with no parameters */ public void testCacheWriter() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); CacheWriter writer = new MyTestCacheWriter(); attrs.setCacheWriter(writer); cache.createRegion("root", attrs); testXml(cache); }
/** * Tests a cache loader an interesting combination of declarables */ public void testCacheLoaderWithDeclarables() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); CacheLoaderWithDeclarables loader = new CacheLoaderWithDeclarables(); attrs.setCacheLoader(loader); cache.createRegion("root", attrs); testXml(cache); }
/** * Tests creating a cache with entries defined in the root region */ public void testEntriesInRootRegion() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("root", new RegionAttributesCreation(cache)); root.put("KEY1", "VALUE1"); root.put("KEY2", "VALUE2"); root.put("KEY3", "VALUE3"); testXml(cache); }
public void testEvictionLRUEntryAttributes() throws Exception { final String rName = getUniqueName(); CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(80, EvictionAction.LOCAL_DESTROY)); cache.createRegion(rName, attrs); testXml(cache); }
public void testEvictionLRUMemoryAttributes() throws Exception { final String rName = getUniqueName(); CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes(10, new EvictionObjectSizer())); cache.createRegion(rName, attrs); testXml(cache); }
public void testEvictionLRUHeapAttributes() throws Exception { final String rName = getUniqueName(); CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setEvictionAttributes(EvictionAttributes .createLRUHeapAttributes(new EvictionObjectSizer(), EvictionAction.LOCAL_DESTROY)); cache.createRegion(rName, attrs); testXml(cache); }
/** * Test EnableBridgeConflation region attribute * @since 4.2 */ public void testEnableBridgeConflationAttribute() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setEnableBridgeConflation(true); cache.createRegion("root", attrs); testXml(cache); assertEquals(true, cache.getRegion("root").getAttributes().getEnableBridgeConflation()); }
/** * Test EnableGateway region attribute * @since 4.2 */ public void testEnableGatewayAttribute() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setEnableGateway(true); cache.createRegion("root", attrs); testXml(cache); assertEquals(true, cache.getRegion("root").getAttributes().getEnableGateway()); }
/** * Test EnableSubscriptionConflation region attribute * @since 5.7 */ public void testEnableSubscriptionConflationAttribute() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setEnableSubscriptionConflation(true); cache.createRegion("root", attrs); testXml(cache); assertEquals(true, cache.getRegion("root").getAttributes().getEnableSubscriptionConflation()); } }
public void testREPLICATE_PROXY() throws CacheException { 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()); }
/** * Tests the is-lock-grantor attribute in xml. */ public void testIsLockGrantorAttribute() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setLockGrantor(true); attrs.setScope(Scope.GLOBAL); attrs.setMirrorType(MirrorType.KEYS_VALUES); cache.createRegion("root", attrs); testXml(cache); assertEquals(true, cache.getRegion("root").getAttributes().isLockGrantor()); }
public void testREPLICATE() throws CacheException { 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()); } public void testREPLICATE_PERSISTENT() throws CacheException {
public void testLOCAL() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("local", "LOCAL"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("local"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.NORMAL, ra.getDataPolicy()); assertEquals(Scope.LOCAL, ra.getScope()); } public void testLOCAL_PERSISTENT() throws CacheException {
public void testREPLICATE_PERSISTENT() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("preplicate", "REPLICATE_PERSISTENT"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("preplicate"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PERSISTENT_REPLICATE, ra.getDataPolicy()); assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope()); } public void testREPLICATE_OVERFLOW() throws CacheException {
public void testLOCAL_PERSISTENT() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("plocal", "LOCAL_PERSISTENT"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("plocal"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PERSISTENT_REPLICATE, ra.getDataPolicy()); assertEquals(Scope.LOCAL, ra.getScope()); } public void testLOCAL_HEAP_LRU() throws CacheException {