private void doOperations(Region<Object, Object> region) {

    // Do a put and a get
    region.put("A", new TestSerializable());
    assertEquals(TestSerializable.class, region.get("A").getClass());

    // Do a cache load
    assertEquals(TestSerializable.class, region.get("B").getClass());

    // Make sure the cache load is in the right object form
    assertEquals(TestSerializable.class, region.get("B").getClass());

    // If we're a client region, try a register interest
    if (region.getAttributes().getPoolName() != null) {
      region.registerInterest(".*", InterestResultPolicy.KEYS_VALUES);
    }

    // Do a query
    try {
      SelectResults queryResults = (SelectResults) getCache().getQueryService()
          .newQuery("select * from " + region.getFullPath()).execute();
      for (Object result : queryResults.asList()) {
        assertEquals(TestSerializable.class, result.getClass());
      }

    } catch (Exception e) {
      Assert.fail("got exception from query", e);
    }


    // TODO Transactions don't work
    // CacheTransactionManager txManager = getCache().getCacheTransactionManager();
    // //Test puts and get in a transaction
    // txManager.begin();
    // region.put("C", new TestSerializable());
    // assertIndexDetailsEquals(TestSerializable.class, region.get("C").getClass());
    // txManager.commit();
    //
    // txManager.begin();
    // assertIndexDetailsEquals(TestSerializable.class, region.get("C").getClass());
    // txManager.commit();
    //
    //
    // //Test cache load in a transaction
    // txManager.begin();
    // assertIndexDetailsEquals(TestSerializable.class, region.get("D").getClass());
    // txManager.commit();
    //
    // txManager.begin();
    // assertIndexDetailsEquals(TestSerializable.class, region.get("D").getClass());
    // txManager.commit();
  }
This test creates the following topology

vm0 a peer accessor for both a PR and a replicate region vm1 a peer data store for a replicate
region and a PR vm2 a client of vm0 vm3 a client vm1

The test then performs all region operations in operationVM, while deserialization is prevented
in disallowDeserializationVM.

If an operation causes a deserialization in the disallow VM, this test will fail.
geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxDeserializationDUnitTest.java