@Test
  public void test005GetStatistics() {
    CacheUtils.log("testGetStatistics");
    String queryStr = "SELECT DISTINCT * FROM " + SEPARATOR + "Portfolios where status='active'";
    Query q = CacheUtils.getQueryService().newQuery(queryStr);
    QueryStatistics qst = q.getStatistics();
    if (qst.getNumExecutions() != 0 && qst.getTotalExecutionTime() != 0) {
      fail("QueryStatistics not initialized properly");
    }
    try {
      Region region = CacheUtils.createRegion("Portfolios", Portfolio.class);
      CacheUtils.getQueryService().createIndex("testIndex", IndexType.FUNCTIONAL, "status",
          SEPARATOR + "Portfolios");
      for (int i = 0; i < 10000; i++) {
        region.put(i + "", new Portfolio(i));
      }
      q.execute();
      qst = q.getStatistics();
      if (qst.getNumExecutions() != 1) { // || qst.getTotalExecutionTime()==0){ // bruce - time
                                         // based CachePerfStats are disabled by default
        fail("QueryStatistics not updated.");
      }

      for (int i = 0; i < 10; i++) {
        q.execute();
      }

    } catch (Exception e) {
      e.printStackTrace();
      fail("Exception during Query.execute");
    }
  }
***
THIS FILE IS ENCODED IN UTF-8 IN ORDER TO TEST UNICODE IN FIELD NAMES. THE ENCODING MUST BE
SPECIFIED AS UTF-8 WHEN COMPILED
*****
geode-core/src/integrationTest/java/org/apache/geode/cache/query/QueryJUnitTest.java