@Test
  public void testAfterCacheCreate() throws Exception {
    // Assert basic region creation when a Distributed and Cache exist
    DistributedSystem ds = DistributedSystem.connect(createGemFireProperties());
    CacheFactory.create(ds);

    RegionFactory factory = new RegionFactory();
    r1 = factory.create(r1Name);
    assertBasicRegionFunctionality(r1, r1Name);
  }
Test RegionFactory with Cache close and DistributedSystem disconnect
geode-core/src/integrationTest/java/org/apache/geode/cache/RegionFactoryJUnitTest.java