void installTransactionListener() {
    txMgr.setListener(new TransactionListener() {
      @Override
      public void afterFailedCommit(TransactionEvent event) {
        failedCommits++;
      }

      @Override
      public void afterCommit(TransactionEvent event) {
        afterCommits++;
      }

      @Override
      public void afterRollback(TransactionEvent event) {
        afterRollbacks++;
      }

      @Override
      public void close() {}
    });
  }
Extracted from TXWriterJUnitTest to share with TXWriterOOMEJUnitTest.
geode-junit/src/main/java/org/apache/geode/TXWriterTestCase.java