@Override public void close() { final InMemoryPersistenceSessionFactory inMemoryPersistenceSessionFactory = getInMemoryPersistenceSessionFactory(); // TODO: this is hacky, only here to keep tests running. Should sort out // using mocks if (inMemoryPersistenceSessionFactory != null) { inMemoryPersistenceSessionFactory.attach(getPersistenceSession(), persistedObjects); persistedObjects = null; } }
@Override public void open() { // TODO: all a bit hacky, but is to keep tests running. Should really // sort out using mocks. final InMemoryPersistenceSessionFactory inMemoryPersistenceSessionFactory = getInMemoryPersistenceSessionFactory(); persistedObjects = inMemoryPersistenceSessionFactory == null ? null : inMemoryPersistenceSessionFactory.getPersistedObjects(); if (persistedObjects == null) { if (inMemoryPersistenceSessionFactory != null) { persistedObjects = inMemoryPersistenceSessionFactory.createPersistedObjects(); } else { persistedObjects = new ObjectStorePersistedObjectsDefault(); } } else { recreateAdapters(); } }