Skip to content

Commit

Permalink
Let the subclasses redefine the configuration file name overriding ge…
Browse files Browse the repository at this point in the history
…tHibernateConfigurationFileName() method.
  • Loading branch information
Hernan authored and adamw committed Jan 4, 2011
1 parent 57fbeaf commit c5da60f
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -31,7 +31,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)) {
Expand All @@ -45,6 +45,9 @@ public void init(@Optional String auditStrategy) throws URISyntaxException {

protected abstract void initMappings() throws MappingException, URISyntaxException ;

protected String getHibernateConfigurationFileName(){
return "hibernate.test.session-cfg.xml";
}


private SessionFactory getSessionFactory(){
Expand Down

0 comments on commit c5da60f

Please sign in to comment.