@Test
  public void testTXRmtMirror() {
    assumeThat(supportsTransactions()).isTrue();
    assumeThat(getRegionAttributes().getScope().isGlobal()).isFalse();
    assumeThat(getRegionAttributes().getDataPolicy().withPersistence()).isFalse();

    assertThat(getRegionAttributes().getScope().isDistributed()).isTrue();
    CacheTransactionManager txMgr = getCache().getCacheTransactionManager();

    final String rgnName = getUniqueName();

    // Make sure that a remote create done in a tx is created in a remote mirror
    // and dropped in a remote non-mirror

    vm0.invoke("textTXRmtMirror: Create Mirrored Region", () -> {
      CacheTransactionManager txMgr2 = getCache().getCacheTransactionManager();
      MyTransactionListener tl = new MyTransactionListener();
      setTxListener(txMgr2, tl);
      try {
        RegionFactory<?, ?> factory = getCache().createRegionFactory(getRegionAttributes());
        factory.setDataPolicy(DataPolicy.REPLICATE);
        createRegion(rgnName, factory);
      } catch (CacheException e) {
        fail("While creating region", e);
      }
    });

    vm1.invoke("textTXRmtMirror: Create Mirrored Region", () -> {
      CacheTransactionManager txMgr2 = getCache().getCacheTransactionManager();
      MyTransactionListener tl = new MyTransactionListener();
      setTxListener(txMgr2, tl);
      try {
        RegionFactory<?, ?> factory = getCache().createRegionFactory(getRegionAttributes());
        factory.setDataPolicy(DataPolicy.NORMAL);
        createRegion(rgnName, factory);
      } catch (CacheException e) {
        fail("While creating region", e);
      }
    });

    Region<String, String> region = createRegion(rgnName);

    txMgr.begin();
    region.create("key", "value");
    logger.info("textTXRmtMirror: create mirror and non-mirror");
    txMgr.commit();

    validateTXRmtMirror(rgnName, vm0, vm1);
  }
Clear all existing transaction listeners and install the given listener.
geode-dunit/src/main/java/org/apache/geode/cache30/MultiVMRegionTestCase.java