mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
58467: Categorized some spring tests so they run in the same vm successfully git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61988 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,8 +20,6 @@ package org.alfresco.util;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.orm.hibernate3.SessionFactoryUtils;
|
||||
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
|
||||
|
||||
@@ -39,8 +37,7 @@ public abstract class BaseSpringTest extends AbstractTransactionalDataSourceSpri
|
||||
{
|
||||
/** protected so that it gets populated if autowiring is done by variable name **/
|
||||
protected SessionFactory sessionFactory;
|
||||
private boolean defaultContext;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -50,7 +47,6 @@ public abstract class BaseSpringTest extends AbstractTransactionalDataSourceSpri
|
||||
this.setAutowireMode(AUTOWIRE_BY_NAME);
|
||||
//this.setDependencyCheck(false);
|
||||
|
||||
defaultContext = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,8 +87,6 @@ public abstract class BaseSpringTest extends AbstractTransactionalDataSourceSpri
|
||||
@Override
|
||||
protected String[] getConfigLocations()
|
||||
{
|
||||
// The derived class is using the default context
|
||||
defaultContext = true;
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
@@ -101,20 +95,4 @@ 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
|
||||
{
|
||||
if (defaultContext)
|
||||
{
|
||||
return (ConfigurableApplicationContext) ApplicationContextHelper.getApplicationContext();
|
||||
}
|
||||
else
|
||||
{
|
||||
String[] configLocations = (String[]) key;
|
||||
return new ClassPathXmlApplicationContext(configLocations);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user