public void testSetEnableSubscriptionConflation() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setEnableSubscriptionConflation(true).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(true, ra.getEnableSubscriptionConflation()); } finally { cleanUpRegion(r1); } }
public void testSetInitialCapacity() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setInitialCapacity(777).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(777, ra.getInitialCapacity()); } finally { cleanUpRegion(r1); } }
public void testSetValueConstraint() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setValueConstraint(String.class).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(String.class, ra.getValueConstraint()); } finally { cleanUpRegion(r1); } }
public void testSetConcurrencyLevel() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setConcurrencyLevel(7).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(7, ra.getConcurrencyLevel()); } finally { cleanUpRegion(r1); } }
public void testSetStatisticsEnabled() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setStatisticsEnabled(true).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(true, ra.getStatisticsEnabled()); } finally { cleanUpRegion(r1); } }
public void testSetIndexMaintenanceSynchronous() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(REPLICATE); r1 = factory.setIndexMaintenanceSynchronous(true).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(true, ra.getIndexMaintenanceSynchronous()); } finally { cleanUpRegion(r1); } }
public void testSetKeyConstraint() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setKeyConstraint(String.class).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(String.class, ra.getKeyConstraint()); } finally { cleanUpRegion(r1); } }
public void testSetLoadFactor() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setLoadFactor(77.7f).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(77.7f, ra.getLoadFactor()); } finally { cleanUpRegion(r1); } }
public void testSetGatewayHubId() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setGatewayHubId("hubId").create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals("hubId", ra.getGatewayHubId()); } finally { cleanUpRegion(r1); } }
public void testSetDataPolicy() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setDataPolicy(DataPolicy.REPLICATE).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(DataPolicy.REPLICATE, ra.getDataPolicy()); } finally { cleanUpRegion(r1); } } public void testSetEarlyAck() throws CacheException, IOException
public void testSetMulticastEnabled() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setMulticastEnabled(true).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(true, ra.getMulticastEnabled()); } finally { cleanUpRegion(r1); } } public void testSetEnableGateway() throws CacheException, IOException
public void testSetLockGrantor() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(REPLICATE); r1 = factory.setScope(Scope.GLOBAL).setLockGrantor(true).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(true, ra.isLockGrantor()); } finally { cleanUpRegion(r1); } }
public void testSetCacheWriter() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(REPLICATE_PROXY); CacheWriter cw = new MyCacheWriter(); r1 = factory.setCacheWriter(cw).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(cw, ra.getCacheWriter()); } finally { cleanUpRegion(r1); } }
public void testAddCacheListener() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(REPLICATE_PROXY); CacheListener cl = new MyCacheListener(); r1 = factory.addCacheListener(cl).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(cl, ra.getCacheListener()); } finally { cleanUpRegion(r1); } }
public void testSetDiskStoreName() throws CacheException, IOException { Cache c = createCache(); c.createDiskStoreFactory().create("ds"); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL_PERSISTENT); r1 = factory.setDiskStoreName("ds").create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals("ds", ra.getDiskStoreName()); } finally { cleanUpRegion(r1); } }
public void testSetCacheLoader() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(REPLICATE_PROXY); CacheLoader cl = new MyCacheLoader(); r1 = factory.setCacheLoader(cl).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(cl, ra.getCacheLoader()); } finally { cleanUpRegion(r1); } }
public void testSetCustomEntryTimeToLive() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); MyCustomExpiry ce = new MyCustomExpiry(); r1 = factory.setCustomEntryTimeToLive(ce).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(ce, ra.getCustomEntryTimeToLive()); } finally { cleanUpRegion(r1); } }
public void testSetEvictionAttributes() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); r1 = factory.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(77)).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(EvictionAttributes.createLRUEntryAttributes(77), ra.getEvictionAttributes()); } finally { cleanUpRegion(r1); } }
public void testLOCAL_OVERFLOW() throws CacheException, IOException { Cache c = new CacheFactory().create(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL_OVERFLOW); r1 = factory.create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(DataPolicy.NORMAL, ra.getDataPolicy()); assertEquals(Scope.LOCAL, ra.getScope()); assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes()); assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE, c.getResourceManager().getEvictionHeapPercentage()); } finally { cleanUpRegion(r1); } } public void testLOCAL_PERSISTENT_OVERFLOW() throws CacheException, IOException
public void testBug45749part2() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(PARTITION_REDUNDANT); factory.setPartitionAttributes(new PartitionAttributesFactory().setTotalNumBuckets(5).setRedundantCopies(2).create()); r1 = factory.create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(DataPolicy.PARTITION, ra.getDataPolicy()); assertNotNull(ra.getPartitionAttributes()); assertEquals(5, ra.getPartitionAttributes().getTotalNumBuckets()); assertEquals(2, ra.getPartitionAttributes().getRedundantCopies()); } finally { cleanUpRegion(r1); } }