Let the subclasses redefine the configuration file name overriding getHibernateConfigurationFileName() method.
This commit is contained in:
parent
188ec620e8
commit
80ef651e4a
|
@ -35,7 +35,7 @@ public abstract class AbstractSessionTest {
|
|||
@Parameters("auditStrategy")
|
||||
public void init(@Optional String auditStrategy) throws URISyntaxException {
|
||||
config = new AnnotationConfiguration();
|
||||
URL url = Thread.currentThread().getContextClassLoader().getResource("hibernate.test.session-cfg.xml");
|
||||
URL url = Thread.currentThread().getContextClassLoader().getResource(getHibernateConfigurationFileName());
|
||||
config.configure(new File(url.toURI()));
|
||||
|
||||
if (auditStrategy != null && !"".equals(auditStrategy)) {
|
||||
|
@ -50,6 +50,9 @@ public abstract class AbstractSessionTest {
|
|||
|
||||
protected abstract void initMappings() throws MappingException, URISyntaxException ;
|
||||
|
||||
protected String getHibernateConfigurationFileName(){
|
||||
return "hibernate.test.session-cfg.xml";
|
||||
}
|
||||
|
||||
|
||||
private SessionFactory getSessionFactory(){
|
||||
|
|
Loading…
Reference in New Issue