*/
minimaDb.init();
// old stories shouls have been deleted
db.get("story1", new GetTestHelp() { public void notFound(String key) {}; });
db.get("story2", new GetTestHelp() { public void notFound(String key) {}; });
db.get("story3", new GetTestHelp() { public void notFound(String key) {}; });
// master key and lists should now be in place
db.get("minimaster", new GetTestHelp() { public void found(String key, int rev, byte[] data) {};} );
db.get("keylisttodo", new GetTestHelp() { public void found(String key, int rev, byte[] data) {};} );
db.get("keylistdoing", new GetTestHelp() { public void found(String key, int rev, byte[] data) {};} );
db.get("keylistdone", new GetTestHelp() { public void found(String key, int rev, byte[] data) {};} );
// stories should have been converted
db.get("story1rx", new GetTestHelp() {
@Override
public void found(String key, int rev, byte[] data) {
assertEquals(1, rev);
Meta<Story> meta = Meta.fromJson(Story.class, data);
assertEquals("story", meta.getName());
assertEquals("desc1", meta.getObj().getDesc());
assertEquals("story1rx", meta.getObj().getId());
assertEquals("keylisttodo", meta.getObj().getList());
}
});
db.get("story2rx", new GetTestHelp() {
@Override
public void found(String key, int rev, byte[] data) {
assertEquals(1, rev);
Meta<Story> meta = Meta.fromJson(Story.class, data);
assertEquals("story", meta.getName());
assertEquals("desc2", meta.getObj().getDesc());
assertEquals("story2rx", meta.getObj().getId());
assertEquals("keylisttodo", meta.getObj().getList());
}
});
db.get("story3rx", new GetTestHelp() {
@Override
public void found(String key, int rev, byte[] data) {
assertEquals(1, rev);
Meta<Story> meta = Meta.fromJson(Story.class, data);
assertEquals("story", meta.getName());