@Test
  public void testWriteOps() throws CacheException {
    txMgr.begin();
    region.put("key1", "value1");
    region.put("key2", "value2");
    assertTrue(region.containsKey("key1"));
    assertTrue(region.containsValueForKey("key1"));
    assertEquals("key1", region.getEntry("key1").getKey());
    assertEquals("value1", region.getEntry("key1").getValue());
    assertEquals("value1", region.get("key1"));
    assertTrue(region.containsKey("key2"));
    assertTrue(region.containsValueForKey("key2"));
    assertEquals("key2", region.getEntry("key2").getKey());
    assertEquals("value2", region.getEntry("key2").getValue());
    assertEquals("value2", region.get("key2"));
    txMgr.rollback();
    assertTrue(!region.containsKey("key1"));
    assertTrue(!region.containsKey("key2"));

    txMgr.begin();
    region.create("key1", "value1");
    assertTrue(region.containsKey("key1"));
    assertTrue(region.containsValueForKey("key1"));
    assertEquals("key1", region.getEntry("key1").getKey());
    assertEquals("value1", region.getEntry("key1").getValue());
    assertEquals("value1", region.get("key1"));
    txMgr.rollback();
    assertTrue(!region.containsKey("key1"));

    region.create("key1", "value1");
    txMgr.begin();
    region.put("key1", "value2");
    txMgr.rollback();
    assertTrue(region.containsKey("key1"));
    assertEquals("value1", region.get("key1"));
    region.localDestroy("key1");

    region.create("key1", "value1");
    txMgr.begin();
    region.localDestroy("key1");
    assertTrue(!region.containsKey("key1"));
    assertTrue(!region.containsValueForKey("key1"));
    txMgr.rollback();
    assertTrue(region.containsKey("key1"));
    region.localDestroy("key1");

    region.create("key1", "value1");
    txMgr.begin();
    region.destroy("key1");
    assertTrue(!region.containsKey("key1"));
    assertTrue(!region.containsValueForKey("key1"));
    txMgr.rollback();
    assertTrue(region.containsKey("key1"));
    region.localDestroy("key1");

    region.create("key1", "value1");
    txMgr.begin();
    assertTrue(region.containsValueForKey("key1"));
    region.localInvalidate("key1");
    assertTrue(region.containsKey("key1"));
    assertTrue(!region.containsValueForKey("key1"));
    assertEquals(null, region.get("key1"));
    txMgr.rollback();
    assertTrue(region.containsValueForKey("key1"));
    region.localDestroy("key1");

    region.create("key1", "value1");
    txMgr.begin();
    assertTrue(region.containsValueForKey("key1"));
    region.invalidate("key1");
    assertTrue(region.containsKey("key1"));
    assertTrue(!region.containsValueForKey("key1"));
    assertEquals(null, region.get("key1"));
    txMgr.rollback();
    assertTrue(region.containsValueForKey("key1"));
    region.localDestroy("key1");

    // see if commits work
    assertTrue(!region.containsKey("key1"));
    assertTrue(!region.containsKey("key2"));
    txMgr.begin();
    region.create("key1", "value1");
    region.create("key2", "value2");
    txMgr.commit();
    assertTrue(region.containsKey("key1"));
    assertTrue(region.containsValueForKey("key1"));
    assertEquals("key1", region.getEntry("key1").getKey());
    assertEquals("value1", region.getEntry("key1").getValue());
    assertEquals("value1", region.get("key1"));
    assertTrue(region.containsKey("key2"));
    assertTrue(region.containsValueForKey("key2"));
    assertEquals("key2", region.getEntry("key2").getKey());
    assertEquals("value2", region.getEntry("key2").getValue());
    assertEquals("value2", region.get("key2"));
    region.localDestroy("key1");
    region.localDestroy("key2");
  }
Tests basic transaction functionality

@since GemFire 4.0
geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java