@Test
  public void testCqOnAccessorServerWithUpdatesResultingInDestroyedCQEvents() throws Exception {

    final Host host = Host.getHost(0);
    VM server1 = host.getVM(0);
    VM server2 = host.getVM(1);
    VM client = host.getVM(2);

    // creating an accessor vm with cache server installed.
    createServer(server1, true);

    createServer(server2);

    // create client
    final int port = server1.invoke(PrCqUsingPoolDUnitTest::getCacheServerPort);
    final String host0 = NetworkUtils.getServerHostName(server1.getHost());

    String poolName = "testPartitionedCqOnAccessorBridgeServer";
    createPool(client, poolName, host0, port);

    // register cq.
    createCQ(client, poolName, "testCQEvents_0", cqs[0]);
    cqHelper.executeCQ(client, "testCQEvents_0", false, null);

    // create values
    final int size = 10;
    createValues(server1, regions[0], size);

    // do updates that results in destroy CQEvents.
    updateValuesToGenerateDestroyCQEvent(server1, regions[0], size);

    // validate cq for expected Destroy CQ events.
    cqHelper.validateCQ(client, "testCQEvents_0",
        /* resultSize: */ CqQueryUsingPoolDUnitTest.noTest, /* creates: */ size,
        /* updates: */ size, /* deletes; */ 0, /* queryInserts: */ size, /* queryUpdates: */ 0,
        /* queryDeletes: */ size, /* totalEvents: */ (size + size));

    // Create values to generate Create CQ Events.
    createValues(server1, regions[0], size);

    cqHelper.validateCQ(client, "testCQEvents_0",
        /* resultSize: */ CqQueryUsingPoolDUnitTest.noTest, /* creates: */ size,
        /* updates: */ size * 2, /* deletes; */ 0, /* queryInserts: */ size * 2,
        /* queryUpdates: */ 0, /* queryDeletes: */ size,
        /* totalEvents: */ CqQueryUsingPoolDUnitTest.noTest);

    cqHelper.closeClient(client);
    cqHelper.closeServer(server2);
    cqHelper.closeServer(server1);
  }
Test for registering cqs on a cache server with local max memory zero.
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PrCqUsingPoolDUnitTest.java