@Test
  public void testCacheRejectsJSonPdxInstanceViolatingValueConstraint() {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    VM vm1 = host.getVM(1);

    final int port = vm0.invoke(() -> createServerRegion(SimpleClass.class));

    vm0.invoke("put value in region", () -> {
      Region r = basicGetCache().getRegion("testSimplePdx");
      String className = "objects.PersonWithoutID";
      try {
        r.put("pdxObject", getTypedJSONPdxInstance(className));
        fail("expected a ClassCastException");
      } catch (ClassCastException e) {
        assertTrue("wrong ClassCastException message: " + e.getMessage(),
            e.getMessage().contains(className));
      }
      return null;
    });
  }
Test that we throw an exception if someone tries to create a pool after we were forced to use a
peer type registry.
geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxClientServerDUnitTest.java