public static Integer createServerCache() throws Exception {
    new HAClearDistributedTest().createCache(new Properties());
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    factory.setDataPolicy(DataPolicy.REPLICATE);
    RegionAttributes attrs = factory.create();
    cache.createRegion(REGION_NAME, attrs);
    server = (CacheServerImpl) cache.addCacheServer();
    assertNotNull(server);
    int port = getRandomAvailableTCPPort();
    server.setPort(port);
    server.start();
    return server.getPort();
  }
The test performs following operations 1. Create 2 servers and 3 clients 2. Perform put
operations for known set of keys directy from the server1. 3. Perform destroyRegion operation
from server1 4. verify the result of operation for other clients and other servers.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/HAClearDistributedTest.java