public void createClientWith2Pools(VM client, final int[] serverPorts1, final int[] serverPorts2,
      final String serverHost, final String redundancyLevel) {
    client.invoke(() -> {
      logger.info("### Create Client. ###");

      // Initialize CQ Service.
      getCache().getQueryService();

      AttributesFactory regionFactory0 = new AttributesFactory();
      AttributesFactory regionFactory1 = new AttributesFactory();
      regionFactory0.setScope(Scope.LOCAL);
      regionFactory1.setScope(Scope.LOCAL);
      if (redundancyLevel != null) {
        ClientServerTestCase.configureConnectionPoolWithNameAndFactory(regionFactory0, serverHost,
            serverPorts1, true,
            Integer.parseInt(redundancyLevel),
            -1, null, "testPoolA", PoolManager.createFactory(), -1, -1, -2,
            -1);
        ClientServerTestCase.configureConnectionPoolWithNameAndFactory(regionFactory1, serverHost,
            serverPorts2, true,
            Integer.parseInt(redundancyLevel),
            -1, null, "testPoolB", PoolManager.createFactory(), -1, -1, -2,
            -1);
      } else {
        ClientServerTestCase.configureConnectionPoolWithNameAndFactory(regionFactory0, serverHost,
            serverPorts1, true,
            -1,
            -1, null, "testPoolA", PoolManager.createFactory(), -1, -1, -2,
            -1);
        ClientServerTestCase.configureConnectionPoolWithNameAndFactory(regionFactory1, serverHost,
            serverPorts2, true,
            -1,
            -1, null, "testPoolB", PoolManager.createFactory(), -1, -1, -2,
            -1);
      }
      createRegion(regions[0], regionFactory0.create());
      createRegion(regions[1], regionFactory1.create());
      logger.info("### Successfully Created Region on Client :" + regions[0]);
      logger.info("### Successfully Created Region on Client :" + regions[1]);

    });
  }
The port on which the cache server was started in this VM
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqQueryDUnitTest.java