final HeapRecordableManager recordableManager = new HeapRecordableManager(
dataManager);
Recordable recordable0 = new Recordable(recordableManager, (byte) 0,
helperBinaryConversion);
final DataRecordIdentifier id0 = new DataRecordIdentifier(0);
recordable0.setDataRecordIdentifier(id0, true);
assertFalse("read must failed",
recordableManager.readAndSetState(recordable0));
recordableManager.attach(recordable0);
recordable0.setStateHaveChanged();
/*
* simulate record added by other data manager users
*/
assertEquals("must alloc #1", new DataRecordIdentifier(1),
allocHeapFileRecord(50));
assertEquals("must alloc #2", new DataRecordIdentifier(2),
allocHeapFileRecord(50));
Recordable recordable3 = new Recordable(recordableManager, (byte) 3,
helperBinaryConversion);
recordableManager.attach(recordable3);
recordable3.setStateHaveChanged();
recordableManager.save();
final DataRecordIdentifier id3 = new DataRecordIdentifier(3);
assertEquals("must be write in #3", id3,
recordable3.getDataRecordIdentifier());
recordable0 = new Recordable(recordableManager, helperBinaryConversion);
recordable0.setDataRecordIdentifier(id0, true);