@Test public void delete() { long recid = e.put(111, SerializerBase.INTEGER); e.commit(); Engine snapshot = e.snapshot(); e.delete(recid, SerializerBase.INTEGER); assertEquals(Integer.valueOf(111), snapshot.get(recid, SerializerBase.INTEGER)); }
@Test public void compareAndSwap() { long recid = e.put(111, SerializerBase.INTEGER); e.commit(); Engine snapshot = e.snapshot(); e.compareAndSwap(recid, 111, 222, SerializerBase.INTEGER); assertEquals(Integer.valueOf(111), snapshot.get(recid, SerializerBase.INTEGER)); }
@Test public void create_snapshot() { Engine e = DBMaker.newMemoryDB().snapshotEnable().makeEngine(); Engine snapshot = TxEngine.createSnapshotFor(e); assertNotNull(snapshot); }
@Test public void notExist() { Engine snapshot = e.snapshot(); long recid = e.put(111, SerializerBase.INTEGER); assertNull(snapshot.get(recid, SerializerBase.INTEGER)); }