| 1 44 package com.ivata.groupware.admin; 45 46 import java.io.File ; 47 import java.util.Properties ; 48 49 import net.sf.hibernate.HibernateException; 50 import net.sf.hibernate.cfg.Configuration; 51 52 import com.ivata.groupware.GroupwareTestCase; 53 54 60 public abstract class AdminTestCase extends GroupwareTestCase { 61 62 66 public AdminTestCase(String arg0) throws HibernateException { 67 super(getHibernateConfiguration(), arg0); 68 } 69 70 79 private static Configuration getHibernateConfiguration() throws HibernateException { 80 Configuration hibernateConfiguration = new Configuration(); 81 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/admin/setting/SettingDO.hbm.xml")); 82 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/admin/security/user/UserDO.hbm.xml")); 83 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/business/addressbook/address/AddressDO.hbm.xml")); 84 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/business/addressbook/address/country/CountryDO.hbm.xml")); 85 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/business/addressbook/person/PersonDO.hbm.xml")); 86 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/business/addressbook/person/group/right/RightDO.hbm.xml")); 87 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/business/addressbook/person/group/right/detail/RightDetailDO.hbm.xml")); 88 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/business/addressbook/person/group/GroupDO.hbm.xml")); 89 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/business/addressbook/person/employee/EmployeeDO.hbm.xml")); 90 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/business/addressbook/telecomaddress/TelecomAddressDO.hbm.xml")); 91 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/navigation/menu/MenuDO.hbm.xml")); 92 hibernateConfiguration.addFile(new File ("../hibernate/target/xdoclet/hibernatedoclet/com/ivata/groupware/navigation/menu/item/MenuItemDO.hbm.xml")); 93 94 Properties hibernateProperties = new Properties (); 95 hibernateProperties.setProperty("hibernate.connection.driver_class", "org.postgresql.Driver"); 96 hibernateProperties.setProperty("hibernate.connection.URL", "jdbc:postgresql://localhost:5432/portal"); 97 hibernateProperties.setProperty("hibernate.connection.username", "postgres"); 98 hibernateProperties.setProperty("hibernate.connection.password", ""); 99 hibernateProperties.setProperty("hibernate.dialect", "net.sf.hibernate.dialect.PostgreSQLDialect"); 100 hibernateProperties.setProperty("hibernate.show_sql", "true"); 101 hibernateConfiguration.setProperties(hibernateProperties); 102 103 return hibernateConfiguration; 104 } 105 106 107 } 108 | Popular Tags |