@Test
  public void testSimpleQueryWithProxyRegion() {
    server1.invoke(() -> createReplicatedProxyRegion(REGION_PROXY_NAME));
    server2.invoke(() -> createReplicatedRegion(REGION_PROXY_NAME));

    locator.waitUntilRegionIsReadyOnExactlyThisManyServers(REGION_PROXY_NAME_PATH, 2);

    server1.invoke(() -> setUpDataForRegion(REGION_PROXY_NAME_PATH));

    int randomInteger = new Random(nanoTime()).nextInt(MAX_RANDOM_INTEGER);

    String queryString = "\"" +
        "select ID , status , createTime , pk, floatMinValue " +
        "from " + REGION_PROXY_NAME_PATH
        + " where ID <= " + randomInteger + "\"";

    String command = new CommandStringBuilder(QUERY)
        .addOption(MEMBER, "server-2")
        .addOption(QUERY, queryString)
        .getCommandString();

    CommandResult commandResult = gfsh.executeAndAssertThat(command).getCommandResult();

    validateSelectResult(commandResult, true, randomInteger + 1,
        "ID", "status", "createTime", "pk", "floatMinValue");
  }
Override to specify the mechanism used to connect to the Locator.
geode-dunit/src/main/java/org/apache/geode/management/internal/cli/commands/QueryCommandDistributedTestBase.java