}
public void testAlloc() throws HeapException {
createHeap(true);
for (int index = 0; index < 10; index++) {
final DataRecordIdentifier identifier = heapDataManager
.getNewDataRecordIdentifier();
final byte[] data = new byte[1000]; // NOPMD
for (int dataIndex = 0; dataIndex < 1000; dataIndex++) {
data[dataIndex] = (byte) index;
}
heapDataManager.writeDataRecord(identifier, data);
logger.info("add #id=" + identifier);
logger.info("--------");
}
checkIntegrity();
closeHeap();
createHeap(false/* remove file */);
for (int identifier = 0; identifier < 10; identifier++) {
final DataRecordIdentifier dataRecordIdentifier = newDataRecordIdentifier(identifier);
final byte[] data = heapDataManager
.readDataRecord(dataRecordIdentifier);
assertNotNull("must exist data for identifier " + identifier, data);
for (int dataIndex = 0; dataIndex < 1000; dataIndex++) {
assertEquals("bad data value at " + dataIndex, data[dataIndex],