Esempio n. 1
0
 @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));
 }
Esempio n. 2
0
 @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));
 }
Esempio n. 3
0
 @Test
 public void create_snapshot() {
   Engine e = DBMaker.newMemoryDB().snapshotEnable().makeEngine();
   Engine snapshot = TxEngine.createSnapshotFor(e);
   assertNotNull(snapshot);
 }
Esempio n. 4
0
 @Test
 public void notExist() {
   Engine snapshot = e.snapshot();
   long recid = e.put(111, SerializerBase.INTEGER);
   assertNull(snapshot.get(recid, SerializerBase.INTEGER));
 }