public static void createClientCache(Integer port1, Integer port2, Integer port3, String rLevel,
      Boolean addListener) throws Exception {
    CacheServerTestUtil.disableShufflingOfEndpoints();
    String host = NetworkUtils.getIPLiteral();

    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");
    new CQListGIIDistributedTest().createCache(props);

    PoolFactory pf = PoolManager.createFactory();
    int endPointCount = 1;
    pf.addServer(host, port1);
    if (port2 != -1) {
      pf.addServer(host, port2);
      endPointCount++;
    }
    if (port3 != -1) {
      pf.addServer(host, port3);
      endPointCount++;
    }
    pf.setRetryAttempts(5);
    pf.setReadTimeout(2500);
    pf.setSocketBufferSize(32768);
    pf.setPingInterval(1000);
    pf.setMinConnections(endPointCount * 2);
    pf.setSubscriptionRedundancy(Integer.parseInt(rLevel));
    pf.setSubscriptionEnabled(true).create("clientPool");

    try {
      cache.getQueryService();
    } catch (Exception cqe) {
      Assert.fail("Failed to getCQService.", cqe);
    }

    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.LOCAL);
    factory.setPoolName("clientPool");

    RegionAttributes attrs = factory.create();
    createRegion(regions[0], "root", attrs);
    createRegion(regions[1], "root", attrs);
    logger = cache.getLogger();
  }
A helper for creating a subregion, potentially using a package protected method to do so.

@param root the parent region
@param name the name of the subregion to create
@param attrs the attributes used to create the subregion
@param internalArgs if not null, then use the package protected creation mechanism
@return the subregion whose parent is the provided root
@see Region#createSubregion(String, RegionAttributes)
@see LocalRegion#createSubregion(String, RegionAttributes, InternalRegionArguments)
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/ha/CQListGIIDistributedTest.java