@Test
  public void testClientRollsbackWithPutAllAndRI() throws Exception {
    Host host = Host.getHost(0);
    VM accessor = host.getVM(0);
    VM datastore = host.getVM(1);
    VM client = host.getVM(2);

    initAccessorAndDataStore(accessor, datastore, 0);
    int port = startServer(accessor);

    createClientRegion(client, port, false, true);

    datastore.invoke(new SerializableCallable<Object>() {
      @Override
      public Object call() {
        Region custRegion = getCache().getRegion(CUSTOMER);
        custRegion.getAttributesMutator().addCacheListener(new ClientListener());
        return null;
      }
    });


    client.invoke(new SerializableCallable<Object>() {
      @Override
      public Object call() {
        Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
        // Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
        // Region<CustId,Customer> refRegion = getCache().getRegion(D_REFERENCE);
        CustId custId = new CustId(1);
        // OrderId orderId = new OrderId(1, custId);
        getCache().getCacheTransactionManager().begin();
        Map map = new HashMap();
        map.put(custId, new Customer("foo", "bar"));
        custRegion.putAll(map);
        // orderRegion.put(orderId, new Order("fooOrder"));
        // refRegion.put(custId, new Customer("foo", "bar"));
        getCache().getCacheTransactionManager().rollback();
        return null;
      }
    });

    client.invoke(new SerializableCallable<Object>() {
      @Override
      public Object call() {
        Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER);
        // Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER);
        // Region<CustId,Customer> refRegion = getCache().getRegion(D_REFERENCE);
        ClientListener cl = (ClientListener) custRegion.getAttributes().getCacheListeners()[0];
        getCache().getLogger().info("SWAP:CLIENTinvoked:" + cl.invoked);
        assertTrue(!cl.invoked);
        assertTrue(!cl.putAllOp);
        assertEquals("it should be 0 but its:" + cl.invokeCount, 0, cl.invokeCount);
        return null;
      }
    });
  }
Tests the basic client-server transaction functionality
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionDUnitTest.java