Package com.gemstone.gemfire.cache

Examples of com.gemstone.gemfire.cache.RegionAttributes


    assertNotNull("The 'persistent' Local Region was not properly configured and initialized!", persistentLocalRegion);
    assertEquals("persistent", persistentLocalRegion.getName());
    assertEquals(Region.SEPARATOR + "persistent", persistentLocalRegion.getFullPath());

    RegionAttributes persistentRegionAttributes = persistentLocalRegion.getAttributes();

    assertNotNull(persistentRegionAttributes);
    assertTrue(persistentRegionAttributes.getDataPolicy().withPersistence());
  }
View Full Code Here


  @SuppressWarnings("rawtypes")
  @Test
  public void testPRSubscriptionDefaultPolicy() throws Exception {
    assertTrue(context.containsBean("partDEFAULT"));
    RegionFactoryBean fb = context.getBean("&partDEFAULT", RegionFactoryBean.class);
    RegionAttributes attrs = TestUtils.readField("attributes", fb);
   
    SubscriptionAttributes sa = attrs.getSubscriptionAttributes();
    assertEquals(InterestPolicy.ALL, sa.getInterestPolicy() );
  }
View Full Code Here

  @SuppressWarnings("rawtypes")
  @Test
  public void testRegionAttributes() throws Exception {
    Region region = ctx.getBean("attr-region", Region.class);
    assertEquals("attr-region", region.getName());
    RegionAttributes attr = region.getAttributes();
    assertEquals(1024, attr.getInitialCapacity());

    PartitionAttributes pa = attr.getPartitionAttributes();
    assertEquals(512, pa.getLocalMaxMemory());
    assertEquals(1, pa.getRedundantCopies());
  }
View Full Code Here

    assertTrue(optionsRegionFactoryBean instanceof PartitionedRegionFactoryBean);
    assertEquals(null, TestUtils.readField("scope", optionsRegionFactoryBean));
    assertEquals("redundant", TestUtils.readField("name", optionsRegionFactoryBean));

    RegionAttributes optionsRegionAttributes = TestUtils.readField("attributes", optionsRegionFactoryBean);

    assertNotNull(optionsRegionAttributes);
    assertTrue(optionsRegionAttributes.getStatisticsEnabled());

    PartitionAttributes optionsRegionPartitionAttributes = optionsRegionAttributes.getPartitionAttributes();

    assertNotNull(optionsRegionPartitionAttributes);
    assertEquals(1, optionsRegionPartitionAttributes.getRedundantCopies());
    assertEquals(4, optionsRegionPartitionAttributes.getTotalNumBuckets());
    assertTrue(optionsRegionPartitionAttributes.getPartitionResolver() instanceof SimplePartitionResolver);
View Full Code Here

    assertTrue(cacheListeners[1] instanceof SimpleCacheListener);

    assertSame(context.getBean("c-loader"), TestUtils.readField("cacheLoader", complexRegionFactoryBean));
    assertSame(context.getBean("c-writer"), TestUtils.readField("cacheWriter", complexRegionFactoryBean));

    RegionAttributes complexRegionAttributes = TestUtils.readField("attributes", complexRegionFactoryBean);

    assertNotNull(complexRegionAttributes);

    PartitionAttributes complexRegionPartitionAttributes = complexRegionAttributes.getPartitionAttributes();

    assertNotNull(complexRegionPartitionAttributes);
    assertEquals(20, complexRegionPartitionAttributes.getLocalMaxMemory());
    assertNotNull(complexRegionPartitionAttributes.getPartitionListeners());
    assertEquals(1, complexRegionPartitionAttributes.getPartitionListeners().length);
View Full Code Here

  public void testFixedPartitionRegion() throws Exception {
    RegionFactoryBean fixedRegionFactoryBean = context.getBean("&fixed", RegionFactoryBean.class);

    assertNotNull(fixedRegionFactoryBean);

    RegionAttributes fixedRegionAttributes = TestUtils.readField("attributes", fixedRegionFactoryBean);

    assertNotNull(fixedRegionAttributes);

    PartitionAttributes fixedRegionPartitionAttributes = fixedRegionAttributes.getPartitionAttributes();

    assertNotNull(fixedRegionPartitionAttributes);

    assertNotNull(fixedRegionPartitionAttributes.getFixedPartitionAttributes());
    assertEquals(3, fixedRegionPartitionAttributes.getFixedPartitionAttributes().size());
View Full Code Here

  @SuppressWarnings("rawtypes")
  @Test
  public void testRRSubscriptionAllPolicy() throws Exception {
    assertTrue(context.containsBean("replicALL"));
    RegionFactoryBean fb = context.getBean("&replicALL", RegionFactoryBean.class);
    RegionAttributes attrs = TestUtils.readField("attributes", fb);
   
    SubscriptionAttributes sa = attrs.getSubscriptionAttributes();
    assertEquals(InterestPolicy.ALL, sa.getInterestPolicy() );
  }
View Full Code Here

  @SuppressWarnings("rawtypes")
  @Test
  public void testPRSubscriptionCacheContentPolicy() throws Exception {
    assertTrue(context.containsBean("partCACHE_CONTENT"));
    RegionFactoryBean fb = context.getBean("&partCACHE_CONTENT", RegionFactoryBean.class);
    RegionAttributes attrs = TestUtils.readField("attributes", fb);
   
    SubscriptionAttributes sa = attrs.getSubscriptionAttributes();
    assertEquals(InterestPolicy.CACHE_CONTENT, sa.getInterestPolicy() );
  }
View Full Code Here

    assertEquals("simple", TestUtils.readField("beanName", simpleRegionFactoryBean));
    assertEquals(false, TestUtils.readField("close", simpleRegionFactoryBean));
    assertNull(TestUtils.readField("scope", simpleRegionFactoryBean));

    RegionAttributes simpleRegionAttributes = TestUtils.readField("attributes", simpleRegionFactoryBean);

    assertNotNull(simpleRegionAttributes);
    assertFalse(simpleRegionAttributes.getConcurrencyChecksEnabled());
    assertEquals(Scope.DISTRIBUTED_NO_ACK, simpleRegionAttributes.getScope());
  }
View Full Code Here

    assertTrue(publisherRegionFactoryBean instanceof ReplicatedRegionFactoryBean);
    assertEquals("publisher", TestUtils.readField("name", publisherRegionFactoryBean));
    assertEquals(Scope.DISTRIBUTED_ACK, TestUtils.readField("scope", publisherRegionFactoryBean));

    RegionAttributes publisherRegionAttributes = TestUtils.readField("attributes", publisherRegionFactoryBean);

    assertTrue(publisherRegionAttributes.getConcurrencyChecksEnabled());
    assertFalse(publisherRegionAttributes.getPublisher());
  }
View Full Code Here

TOP

Related Classes of com.gemstone.gemfire.cache.RegionAttributes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.