BSFile uses a wrapper for DiskBlock to add BSFile specific stuff

This keeps the DiskBlock class clean, so that it can be used
for PersistentMap.
This commit is contained in:
2018-10-14 17:13:33 +02:00
parent c83b6e11e2
commit 3855d03ead
6 changed files with 138 additions and 78 deletions

View File

@@ -6,6 +6,7 @@ import java.nio.file.Path;
import org.lucares.pdb.diskstorage.DiskStorage;
import org.lucares.utils.file.FileUtils;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -31,8 +32,11 @@ public class PersistentMapTest {
try (final DiskStorage ds = new DiskStorage(file)) {
final PersistentMap map = new PersistentMap(ds);
map.put("key1", "value1");
map.getAsString("key1");
final String value1 = "value1";
map.put("key1", value1);
final String actualValue1 = map.getAsString("key1");
Assert.assertEquals(actualValue1, value1);
}
}
}