mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
BaseSpringTest uses ApplicationContextHelper, which now ensures that the context is only started once.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5727 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,6 +26,7 @@ package org.alfresco.util;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.orm.hibernate3.SessionFactoryUtils;
|
||||
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
|
||||
|
||||
@@ -86,6 +87,7 @@ public abstract class BaseSpringTest extends AbstractTransactionalDataSourceSpri
|
||||
*
|
||||
* @return an array containing the config locations
|
||||
*/
|
||||
@Override
|
||||
protected String[] getConfigLocations()
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -94,4 +96,13 @@ public abstract class BaseSpringTest extends AbstractTransactionalDataSourceSpri
|
||||
}
|
||||
return ApplicationContextHelper.CONFIG_LOCATIONS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignores the key and loads the {@link ApplicationContextHelper application context}.
|
||||
*/
|
||||
@Override
|
||||
protected ConfigurableApplicationContext loadContext(Object key) throws Exception
|
||||
{
|
||||
return (ConfigurableApplicationContext) ApplicationContextHelper.getApplicationContext();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user