public void closeClient(VM client) {
    SerializableRunnable closeCQService = new CacheSerializableRunnable("Close Client") {
      @Override
      public void run2() throws CacheException {
        LogWriterUtils.getLogWriter().info("### Close Client. ###");
        try {
          ((DefaultQueryService) getCache().getQueryService()).closeCqService();
        } catch (Exception ex) {
          LogWriterUtils.getLogWriter()
              .info("### Failed to get CqService during ClientClose() ###");
          // TODO: fix eaten exception
        }
      }
    };

    client.invoke(closeCQService);
    Wait.pause(1000);
  }
Create a cache server with partitioned region.

@param server VM where to create the cache server.
@param port cache server port.
@param isAccessor if true the under lying partitioned region will not host data on this vm.
@param redundantCopies number of redundant copies for the primary bucket.
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java