@Test
  public void testQueryOnSingleDataStore() throws Exception {

    logger.info("PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Test Started  ");

    logger.info("PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: creating PR Region ");

    final Region region =
        PartitionedRegionTestHelper.createPartitionedRegion(regionName, localMaxMemory, redundancy);

    final Region localRegion = PartitionedRegionTestHelper.createLocalRegion(localRegionName);

    final StringBuilder errorBuf = new StringBuilder();

    PortfolioData[] portfolios = new PortfolioData[dataSize];

    try {
      for (int j = 0; j < dataSize; j++) {
        portfolios[j] = new PortfolioData(j);
      }
      logger.info(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: populating PortfolioData into the PR Datastore  ");

      populateData(region, portfolios);

      logger.info(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: populating PortfolioData into the PR Datastore  ");

      populateData(localRegion, portfolios);
      final String[] queryString =
          {"ID = 0 OR ID = 1", "ID > 4 AND ID < 9", "ID = 5", "ID < 5 ", "ID <= 5"};

      logger.info(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Creating a Thread which will fire queries on the datastore");

      Thread t1 = new Thread(() -> {
        final String expectedRegionDestroyedException = RegionDestroyedException.class.getName();

        logger.info("<ExpectedException action=add>" + expectedRegionDestroyedException
            + "</ExpectedException>");

        for (final String s : queryString) {

          try {

            SelectResults resSetPR = region.query(s);
            SelectResults resSetLocal = localRegion.query(s);
            String failureString =
                PartitionedRegionTestHelper.compareResultSets(resSetPR, resSetLocal);
            Thread.sleep(delayQuery);
            if (failureString != null) {
              errorBuf.append(failureString);
              throw (new Exception(failureString));

            }

          } catch (InterruptedException ie) {
            fail("interrupted");
          } catch (QueryInvocationTargetException qite) {
            logger.info(
                "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: QueryInvocationTargetException as Expected "
                    + qite);

          } catch (RegionDestroyedException rde) {
            logger.info(
                "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: RegionDestroyedException as Expected "
                    + rde);

          } catch (RegionNotFoundException rnfe) {
            logger.info(
                "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: RegionNotFoundException as Expected "
                    + rnfe);

          } catch (Exception qe) {
            logger.info(
                "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Unexpected Exception "
                    + qe);

            encounteredException = true;
            StringWriter sw = new StringWriter();
            qe.printStackTrace(new PrintWriter(sw));
            errorBuf.append(sw);

          }

        }
        logger.info("<ExpectedException action=remove>" + expectedRegionDestroyedException
            + "</ExpectedException>");

      });
      logger.info(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Creating a Thread which will call Region.destroyRegion() on the datastore ");

      Thread t2 = new Thread(() -> {
        try {
          Thread.sleep(2500);
        } catch (InterruptedException ie) {
          logger.info(
              "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore:Thread Interrupted Exceptionduring region Destroy ");
          fail("interrupted");
        }
        region.destroyRegion();
      });

      logger.info(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Initiating the  Threads");

      t1.start();
      t2.start();

      logger.info(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Waiting for the Threads to join ");

      ThreadUtils.join(t1, 30 * 1000);
      ThreadUtils.join(t2, 30 * 1000);
      logger.info(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: checking for any Unexpected Exception's occurred");

      assertFalse(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Exception occurred in Query-thread",
          encounteredException);
    } catch (Exception e) {
      e.printStackTrace();
      fail(
          "PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Test failed because of exception "
              + e);

    }

    logger.info("PRQueryRegionDestroyedJUnitTest#testQueryOnSingleDataStore: Test Ended");

  }
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. <br>
2. Puts some test Objects in cache.<br>
3. Create a Thread and fire queries on the data and verifies the result.<br>
4. Create another Thread and call Region#destroyRegion() on the PR region.<br>
geode-core/src/integrationTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionDestroyedJUnitTest.java