FilePersistenceDataCorruptedException,
FilePersistenceNotSerializableException,
FilePersistenceTooBigForSerializationException, ProxyException {
final IInstanceFactory instanceFactory = session.getInstanceFactory();
session.open();
BobForAutoSaveInMethodTest bob = BobForAutoSaveInMethodTest
.newInstance(instanceFactory);
assertEquals("bad initial state", 0, bob.getValue());
saveDoneFlag = false;
int expectedIncrement = 1;
for (int count = 0; count < 5; count++) {
bob.incrementValue();
assertTrue(MUST_SAVE, saveDoneFlag);
assertTrue("must be unloaded", ProxyManager2.isUnloaded(bob));
assertEquals("bad state", expectedIncrement, bob.getValue());
expectedIncrement++;
}
session.setObject(KEY, bob);
session.close();
session.open();
bob = (BobForAutoSaveInMethodTest) session.getObject(KEY);
assertEquals("bad state", expectedIncrement - 1, bob.getValue());
session.close();
}