@Test public void snapshot_after_rollback() { e = openEngine(); if (!e.canSnapshot() || !e.canRollback()) return; long recid = e.put("a", Serializer.STRING); Engine snapshot = e.snapshot(); e.update(recid, "b", Serializer.STRING); assertEquals("a", snapshot.get(recid, Serializer.STRING)); e.rollback(); assertEquals("a", snapshot.get(recid, Serializer.STRING)); e.close(); }
@Test public void rollback() { e = openEngine(); long recid = e.put("aaa", Serializer.STRING_NOSIZE); e.commit(); e.update(recid, "bbb", Serializer.STRING_NOSIZE); if (!canRollback()) return; e.rollback(); assertEquals("aaa", e.get(recid, Serializer.STRING_NOSIZE)); e.close(); }