1 28 package de.nava.informa.utils.manager.hibernate; 29 30 import de.nava.informa.utils.FileUtils; 31 import de.nava.informa.utils.InformaTestCase; 32 import de.nava.informa.utils.manager.PersistenceManagerIF; 33 import de.nava.informa.utils.manager.TestAbstractPersistenceManager; 34 35 import java.io.File ; 36 37 42 public class TestHibernatePersistenceManager extends TestAbstractPersistenceManager { 43 44 private final static String FS = System.getProperty("file.separator"); 45 46 static { 47 final String sourcePath = InformaTestCase.getDataDir() + FS + "hibernate"; 48 49 String dest = InformaTestCase.getOutputDir() + FS + "hibernate"; 50 51 File destDir = new File (dest); 52 if (!destDir.exists()) { 53 destDir.mkdir(); 54 } 55 destDir.deleteOnExit(); 56 57 FileUtils.copyFile(new File (sourcePath + FS + "informa.script"), new File (dest + FS + "informa.script")); 58 FileUtils.copyFile(new File (sourcePath + FS + "informa.properties"), new File (dest + FS + "informa.properties")); 59 60 System.setProperty("hibernate.dialect", "net.sf.hibernate.dialect.HSQLDialect"); 62 System.setProperty("hibernate.connection.driver_class", "org.hsqldb.jdbcDriver"); 63 System.setProperty("hibernate.connection.url", "jdbc:hsqldb:" + dest + FS + "informa"); 64 System.setProperty("hibernate.connection.username", "sa"); 65 System.setProperty("hibernate.connection.password", ""); 66 System.setProperty("hibernate.show_sql", "false"); 67 } 68 69 74 protected PersistenceManagerIF getManager() { 75 return new PersistenceManager(); 76 } 77 } 78 | Popular Tags |