HeapRecordableException, ObjectIOException, RBTException,
ObjectIOClassNotFoundException, ClassInfoException {
final HelperBinaryConversion helperBinaryConversion = new HelperBinaryConversion();
// FIXMELUC x needed helperBinaryConversion.initialize ?
// helperBinaryConversion.initialize(classInfoFactory, objectIOManager);
final HeapRecordableManager recordableManager = new HeapRecordableManager(
dataManager);
final StoreHeader storeHeader = new StoreHeader(recordableManager,
helperBinaryConversion);
assertNull("not root for class name list",
storeHeader.getClassNameListRootDataRecordIdentifier());
assertNull("no root for to garbage",
storeHeader.getGarbageCandidateRootDataRecordIdentifier());
recordableManager.attach(storeHeader);
assertEquals("must be first record",
StoreForTest.IDENTIFIER_FOR_STORE_HEADER,
storeHeader.getDataRecordIdentifier());
storeHeader.setStateHaveChanged();
recordableManager.save();
dataManager.flush();
final ClassInfoFactory classInfoFactory = new ClassInfoFactory(1);
classInfoFactory.setConversionManager(new ConversionManager(
classInfoFactory));
final ClassNameManager classNameManager = new ClassNameManager(
recordableManager, storeHeader, classInfoFactory,
helperBinaryConversion);
classNameManager.load();
assertEquals("must be class #0", 0,
classNameManager.getIdentifier(classInfoFactory
.getNoProxyClassInfo(this.getClass())));
assertTrue("store header must changed", storeHeader.isStateChanged());
recordableManager.save();
assertFalse("store header must unchanged", storeHeader.isStateChanged());
assertEquals("must be class #1", 1,
classNameManager.getIdentifier(classInfoFactory
.getNoProxyClassInfo(Integer.class)));
assertTrue("store header must changed", storeHeader.isStateChanged());
recordableManager.save();
assertFalse("store header must unchanged", storeHeader.isStateChanged());
dataManager.flush();
classNameManager.clear();
classNameManager.load();
assertEquals("must be class #0", 0,
classNameManager.getIdentifier(classInfoFactory
.getNoProxyClassInfo(this.getClass())));
assertEquals("must be class #1", 1,
classNameManager.getIdentifier(classInfoFactory
.getNoProxyClassInfo(Integer.class)));
assertEquals("must be class #2", 2,
classNameManager.getIdentifier(classInfoFactory
.getNoProxyClassInfo(String.class)));
assertEquals("must be this.getClass", this.getClass(), classNameManager
.getObjectClassInfo(0).getObjectClass());
assertEquals("must be Integer.class", Integer.class, classNameManager
.getObjectClassInfo(1).getObjectClass());
assertEquals("must be String.class", String.class, classNameManager
.getObjectClassInfo(2).getObjectClass());
assertTrue("store header must changed", storeHeader.isStateChanged());
recordableManager.save();
dataManager.flush();
classNameManager.clear();
classNameManager.load();
assertEquals("must be class #0", 0,