public static void registerCq(String name, String Cquery, Boolean cqWithIR) {
    QueryService cqService = null;
    // get cq service
    try {
      cqService = cache.getQueryService();
    } catch (Exception cqe) {
      cqe.printStackTrace();
      fail("Failed to getCqService.");
    }

    // Create CQ Attributes.
    // do not attach any listiner lets see its response
    CqAttributesFactory cqf = new CqAttributesFactory();
    CqAttributes cqa = cqf.create();

    // Create and Execute CQ.
    try {
      CqQuery cq1 = cqService.newCq(name, Cquery, cqa);
      assertTrue("newCq() state mismatch", cq1.getState().isStopped());
      if (cqWithIR) {
        cq1.executeWithInitialResults();
      } else {
        cq1.execute();
      }
    } catch (Exception ex) {
      fail("Failed to create CQ " + cqName1, ex);
    }

    CqQuery cQuery = cqService.getCq(name);
    if (cQuery == null) {
      fail("Failed to get CqQuery for CQ : " + cqName1);
    }
  }
This test does the following for cq registration with initial result set through pool when
<b>failover</b>(<b>cq registration</b>):<br>
1)Verifies when primary goes down, cq registration happen <br>
2)Verifies create entry for region in map stored in CacheCleintProxy <br>
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DeltaToRegionRelationCQRegistrationDUnitTest.java