@Test
  public void testOrderByQuery() throws Exception {
    Region region = PartitionedRegionTestHelper.createPartitionedRegion(regionName, "100", 0);
    String[] values = new String[100];
    for (int j = 0; j < 100; j++) {
      values[j] = "" + j;
    }
    PRQueryProcessor.TEST_NUM_THREADS = 10;
    try {
      populateData(region, values);

      String queryString =
          "Select distinct p from " + SEPARATOR + region.getName() + " p order by p";
      Query query = region.getCache().getQueryService().newQuery(queryString);
      SelectResults sr = (SelectResults) query.execute();

      Assert.assertTrue(sr.size() == 100);
    } finally {
      PRQueryProcessor.TEST_NUM_THREADS = 0;
      region.close();
    }
  }
Tests the execution of query on a PartitionedRegion created on a single data store. <br>
1. Creates a PR with redundancy=0 on a single VM. 2. Puts some test Objects in cache. 3. Fires
queries on the data and verifies the result.
geode-core/src/integrationTest/java/org/apache/geode/cache/query/partitioned/PRQueryNumThreadsJUnitTest.java