FilePersistenceNotSerializableException,
FilePersistenceTooBigForSerializationException {
final IDataAccessSession session = filePersistence
.createDataAccessSession();
final Bob1 bob1 = new Bob1();
final Bob2 bob2 = new Bob2();
bob2.setVal(0);
bob1.setBob2(bob2);
final Bob3 bob3 = new Bob3();
bob3.setVal(0);
bob1.setBob3(bob3);
bob1.setVal(0);
session.open();
session.setObject(KEY, bob1);
session.close(EnumFilePersistenceCloseAction.SAVE);
session.open();
Bob1 bob1Read = (Bob1) session.getObject(KEY);
assertEquals("bad state for val", 0, bob1Read.getVal());
assertEquals("read must be equals to saved", bob1, bob1Read);
bob1Read.setVal(1);
session.close(EnumFilePersistenceCloseAction.SAVE);
session.open();
bob1Read = (Bob1) session.getObject(KEY);
assertEquals("bad state for val", 1, bob1Read.getVal());
assertFalse("read must not be equals to modified",
bob1.equals(bob1Read));
bob1Read.setVal(2);
session.close(EnumFilePersistenceCloseAction.SAVE);
session.open();
bob1Read = (Bob1) session.getObject(KEY);
assertEquals("bad state for val", 2, bob1Read.getVal());
final Bob2 bob2Bis = new Bob2();
bob2.setVal(1);
bob1Read.setBob2(bob2Bis);
final Bob3 bob3Bis = new Bob3();
bob3.setVal(1);
bob1Read.setBob3(bob3Bis);
session.close(EnumFilePersistenceCloseAction.SAVE);
final Bob1 bob1Bis = new Bob1();
bob1Bis.setVal(2);
bob1Bis.setBob2(bob2Bis);
bob1Bis.setBob3(bob3Bis);
session.open();
bob1Read = (Bob1) session.getObject(KEY);
assertEquals("bad state", bob1Bis, bob1Read);
session.close(EnumFilePersistenceCloseAction.SAVE);