FilePersistenceInvalidClassException,
FilePersistenceNotSerializableException,
FilePersistenceClassNotFoundException,
FilePersistenceDataCorruptedException, ProxyException,
FilePersistenceTooBigForSerializationException, TestException {
BobInnerClass bob = new BobInnerClass();
bob.setEntry("hello");
// final FilePersistence filePersistence = new FilePersistence(1, null,
// TestConstant.getRuntimeDir(), true, false);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setFileAccessMode(EnumFileAccessMode.MAPPED_RANDOM_FILE_ACCESS);
builder.setMaxBufferSize(8 * 1024);
builder.setMaxNumberOfBuffer(32);
builder.setPathName(TestConstant.getWinRamDiskRuntimeDir());
builder.setProxyMode(true);
builder.setRemoveFiles(false);
builder.setGarbageManagement(false);
builder.setCrashSafeMode(false);
final IFilePersistence filePersistence = builder.build();
final IDataAccessSession dataAccessSession = filePersistence
.createDataAccessSession();
dataAccessSession.open();
dataAccessSession.setObject("bob", bob);
dataAccessSession.close(EnumFilePersistenceCloseAction.SAVE);
dataAccessSession.open();
bob = (BobInnerClass) dataAccessSession.getObject("bob");
final Entry entry = bob.getEntry();
final boolean proxy = ProxyManager2.isProxyOrEnhanced(entry);
dataAccessSession.close(EnumFilePersistenceCloseAction.DO_NOT_SAVE);
filePersistence.close();
assertTrue("must be a proxy", proxy);