public void addPoisonedTransactionListeners() {
    MyTestTransactionListener listener = new MyTestTransactionListener();
    getCache().getCacheTransactionManager().addListener(listener);
    getCache().getCacheTransactionManager().setWriter(listener);
  }
add a listener and writer that will throw an exception when invoked if events are for internal
regions
geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxSerializableDUnitTest.java