use of com.manydesigns.portofino.modules.DatabaseModule in project Portofino by ManyDesigns.
the class PersistenceTest method setup.
protected void setup(FileObject appDir) throws Exception {
Configuration configuration = new PropertiesConfiguration();
final DatabasePlatformsRegistry databasePlatformsRegistry = new DatabasePlatformsRegistry(configuration);
databasePlatformsRegistry.addDatabasePlatform(new H2DatabasePlatform());
databaseModule = new DatabaseModule() {
@Override
public void destroy() {
if (subscription != null) {
subscription.dispose();
subscription = null;
}
}
};
databaseModule.applicationDirectory = appDir;
databaseModule.configuration = new ConfigurationSource(configuration, null);
persistence = databaseModule.getPersistence(databasePlatformsRegistry, new CacheResetListenerRegistry());
databaseModule.init();
persistence.start();
setupJPetStore();
setupHibernateTest();
persistence.initModel();
}
Aggregations