@Test
public void testBugOnBigIndex() throws IOException {
File tmpFile = File.createTempFile("hawtdb", "test");
PageFileFactory pageFactory = new PageFileFactory();
pageFactory.setFile(tmpFile);
pageFactory.open();
PageFile page = pageFactory.getPageFile();
BTreeIndexFactory<String, String> indexFactory = new BTreeIndexFactory<String, String>();
indexFactory.setComparator(new Comparator<String>() {
public int compare(String o1, String o2) {
return o1.compareTo(o2) * -1;
}
});
SortedIndex<String, String> index = indexFactory.create(page);
int total = 10000;
Random generator = new Random();
for (int i = 0; i < total; i++) {
index.put("" + generator.nextLong(), "");
}
pageFactory.close();
}