@Test
  public void testCreateExtensions() throws Exception {

    // create caching member
    dataMember = clusterStartupRule.startServerVM(1, locator.getPort());

    // Connect Gfsh to locator.
    gfsh.connectAndVerify(locator);

    createRegion(REPLICATE_REGION, RegionShortcut.REPLICATE, null);
    createMockRegionExtension(REPLICATE_REGION, "value1");
    alterMockRegionExtension(REPLICATE_REGION, "value2");
    createMockCacheExtension("value1");
    alterMockCacheExtension("value2");

    // Start a new member which receives the shared configuration
    // Verify the config creation on this member
    MemberVM newMember = clusterStartupRule.startServerVM(2, locator.getPort());
    newMember.invoke(() -> {
      InternalCache cache = ClusterStartupRule.getCache();
      assertNotNull(cache);

      Region<?, ?> region1 = cache.getRegion(REPLICATE_REGION);
      assertNotNull(region1);

      // MockRegionExtension verification
      @SuppressWarnings("unchecked")
      // should only be one region extension
      final MockRegionExtension mockRegionExtension =
          (MockRegionExtension) ((Extensible<Region<?, ?>>) region1).getExtensionPoint()
              .getExtensions().iterator().next();
      assertNotNull(mockRegionExtension);
      assertEquals(1, mockRegionExtension.beforeCreateCounter.get());
      assertEquals(1, mockRegionExtension.onCreateCounter.get());
      assertEquals("value2", mockRegionExtension.getValue());

      // MockCacheExtension verification
      // should only be one cache extension
      final MockCacheExtension mockCacheExtension =
          (MockCacheExtension) cache.getExtensionPoint().getExtensions().iterator().next();
      assertNotNull(mockCacheExtension);
      assertEquals(1, mockCacheExtension.beforeCreateCounter.get());
      assertEquals(1, mockCacheExtension.onCreateCounter.get());
      assertEquals("value2", mockCacheExtension.getValue());
    });
  }
Tests for {@link Extension}, {@link Extensible}, {@link XmlParser}, {@link XmlGenerator},
{@link XmlEntity} as it applies to Extensions. Asserts that Mock Extension is created and
altered on region and cache.

@since GemFire 8.1
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/extension/ExtensionClusterConfigurationDUnitTest.java