@Override
      public void run2() throws CacheException {
        SelectResults results = null;
        Comparator comparator = null;
        Object[] resultsArray = null;
        QueryService remoteQueryService = null;
        QueryService localQueryService = null;
        SelectResults[][] rs = new SelectResults[1][2];

        try {
          remoteQueryService = (PoolManager.find(poolName)).getQueryService();
          localQueryService = getCache().getQueryService();
        } catch (Exception e) {
          Assert.fail("Failed to get QueryService.", e);
        }

        try {
          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
              .info("### Executing Query on server:" + queryStr);
          Query query = remoteQueryService.newQuery(queryStr);
          rs[0][0] = (SelectResults) query.execute();
          // printResults (rs[0][0], " ### Remote Query Results : ####");
          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
              .info("### Executing Query locally:" + queryStr);
          query = localQueryService.newQuery(queryStr);
          rs[0][1] = (SelectResults) query.execute();
          org.apache.geode.test.dunit.LogWriterUtils.getLogWriter()
              .info("### Remote Query rs size: " + (rs[0][0]).size() + "Local Query rs size: "
                  + (rs[0][1]).size());
          // printResults (rs[0][1], " ### Local Query Results : ####");
          // Compare local and remote query results.
          if (!CacheUtils.compareResultsOfWithAndWithoutIndex(rs)) {
            fail("Local and Remote Query Results are not matching for query :" + queryStr);
          }
        } catch (Exception e) {
          Assert.fail("Failed executing " + queryStr, e);
        }
      }
The port on which the cache server was started in this VM
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxQueryCQTestBase.java