public void testSnapshot()
throws Exception
{
DbStringWrapper db = new DbStringWrapper(new Options(), databaseDir);
db.put("foo", "v1");
Snapshot s1 = db.getSnapshot();
db.put("foo", "v2");
Snapshot s2 = db.getSnapshot();
db.put("foo", "v3");
Snapshot s3 = db.getSnapshot();
db.put("foo", "v4");
assertEquals("v1", db.get("foo", s1));
assertEquals("v2", db.get("foo", s2));
assertEquals("v3", db.get("foo", s3));
assertEquals("v4", db.get("foo"));
s3.close();
assertEquals("v1", db.get("foo", s1));
assertEquals("v2", db.get("foo", s2));
assertEquals("v4", db.get("foo"));
s1.close();