use of com.jd.blockchain.storage.service.DbConnectionFactory in project jdchain-core by blockchain-jd-com.
the class RocksDBStorageTest method test.
@Test
public void test() {
String dbUri = initEmptyDB("rocksdb_storage_test");
long expectedVersion;
try (DbConnectionFactory dbConnFactory = new RocksDBConnectionFactory()) {
DbConnection conn = dbConnFactory.connect(dbUri);
VersioningKVStorage verStorage = conn.getStorageService().getVersioningKVStorage();
ExPolicyKVStorage exStorage = conn.getStorageService().getExPolicyKVStorage();
expectedVersion = test(verStorage);
test(exStorage);
}
try (DbConnectionFactory dbConnFactory = new RocksDBConnectionFactory()) {
DbConnection conn = dbConnFactory.connect(dbUri);
VersioningKVStorage verStorage = conn.getStorageService().getVersioningKVStorage();
ExPolicyKVStorage exStorage = conn.getStorageService().getExPolicyKVStorage();
testAfterReload(verStorage, expectedVersion);
testAfterReload(exStorage);
}
}
Aggregations