leafPage.updateByteSize();
IPageRecordable pageRecordable = leafPage;
assertNull(MUST_BE_NOT_STORED, pageRecordable.getPageRecord());
btreePlusElementMgr.appendPageRecordable(pageRecordable);
pageRecordable.setValueIsChangedValueToSave();
IPageRecord pageRecord = pageRecordable.getPageRecord();
assertNotNull(MUST_BE_STORED, pageRecord);
assertEquals(BAD_RECORD_POSITION, PageConstant.PAGE_SIZE * 1,
pageRecord.getPositionInFile());
assertEquals(BAD_LAST_RECORD_POSITION, PageConstant.PAGE_SIZE * 1,
btreePlusElementMgr.getLastRecordPositionInFile());
NonTerminalPage nonTerminalPage = new NonTerminalPage(1, true);
nonTerminalPage.setKey(0, new DataRecordIdentifier());
pageRecordable = nonTerminalPage;
pageRecordable.updateByteSize();
assertNull(MUST_BE_NOT_STORED, pageRecordable.getPageRecord());
btreePlusElementMgr.appendPageRecordable(pageRecordable);
pageRecordable.setValueIsChangedValueToSave();
pageRecord = pageRecordable.getPageRecord();
assertNotNull(MUST_BE_STORED, pageRecord);
assertEquals(BAD_RECORD_POSITION, PageConstant.PAGE_SIZE * 2,
pageRecord.getPositionInFile());
assertEquals(BAD_LAST_RECORD_POSITION, PageConstant.PAGE_SIZE * 2,
btreePlusElementMgr.getLastRecordPositionInFile());
btreePlusElementMgr.closeTransaction();
assertEquals("", PageConstant.PAGE_SIZE * 3, btreePlusElementMgr
.getFileForStorable().getFileSize());
btreePlusElementMgr.openTransaction();
final int numberOfKeyEntries = 1;
final DataRecordIdentifier[] keys = new DataRecordIdentifier[] { new DataRecordIdentifier(
0) };
final long[] pagePosition = new long[] { 0, 1 };
pageRecordable = new NonTerminalPage(numberOfKeyEntries, keys,
pagePosition, true);
assertNull(MUST_BE_NOT_STORED, pageRecordable.getPageRecord());
btreePlusElementMgr.appendPageRecordable(pageRecordable);
pageRecordable.setValueIsChangedValueToSave();
pageRecord = pageRecordable.getPageRecord();
assertNotNull(MUST_BE_STORED, pageRecord);
assertEquals(BAD_RECORD_POSITION, PageConstant.PAGE_SIZE * 3,
pageRecord.getPositionInFile());
assertEquals(BAD_LAST_RECORD_POSITION, PageConstant.PAGE_SIZE * 3,
btreePlusElementMgr.getLastRecordPositionInFile());
btreePlusElementMgr.closeTransaction();
assertEquals("", PageConstant.PAGE_SIZE * 4, btreePlusElementMgr
.getFileForStorable().getFileSize());