Revert 'Make working with new bytes' and a couple of fixes

This commit is contained in:
leventov
2015-07-01 10:45:48 +03:00
parent a61ea2240d
commit 5c8f737654
41 changed files with 5992 additions and 6208 deletions
@@ -34,32 +34,21 @@ public class MarkTest {
@Test(timeout = 25000)
public void inMemoryTest() {
test(new SerializableFunction<ChronicleMapBuilder<Integer, Integer>, ChronicleMap<Integer, Integer>>() {
@Override
public ChronicleMap<Integer, Integer> apply(
ChronicleMapBuilder<Integer, Integer> builder) {
return builder.create();
}
});
test(builder -> builder.create());
}
@Test(timeout = 25000)
@Test
public void persistedTest() {
int rnd = new Random().nextInt();
final File db = Paths.get(System.getProperty("java.io.tmpdir"), "mark" + rnd).toFile();
if (db.exists())
db.delete();
try {
test(new SerializableFunction<ChronicleMapBuilder<Integer, Integer>,
ChronicleMap<Integer, Integer>>() {
@Override
public ChronicleMap<Integer, Integer> apply(
ChronicleMapBuilder<Integer, Integer> builder) {
try {
return builder.createPersistedTo(db);
} catch (IOException e) {
throw new AssertionError(e);
}
test(builder -> {
try {
return builder.createPersistedTo(db);
} catch (IOException e) {
throw new AssertionError(e);
}
});
System.out.println(MemoryUnit.BYTES.toMegabytes(db.length()) + " MB");