mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
77138: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 73642: Merged DEV to PLATFORM1(4.3.0) ACE-1996: Cluster: Web client extensions not distributed: 72232: MNT-9882: Cluster: Web client extensions not distributed - Use asynchronously refreshed cache in diactionaryDAO 73275: MNT-9882: Cluster: Web client extensions not distributed - Add javadocs, remove excess classes. 73509: MNT-9882: Cluster: Web client extensions not distributed - Remove stale configs for "compiledModelsSharedCache", remove unreachable code from DictionaryDAOImpl, return value from NoOpCompiledModelsCache.get() method. 73591: ACE-1996: Cluster: Web client extensions not distributed - Remove NoOpCompiledModelsCache. - Modify unit tests that uses CompiledModelCache git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@77994 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -23,10 +23,12 @@ import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.alfresco.repo.cache.NullCache;
|
||||
import org.alfresco.repo.dictionary.CompiledModelsCache;
|
||||
import org.alfresco.repo.dictionary.CompiledModel;
|
||||
import org.alfresco.repo.dictionary.DictionaryBootstrap;
|
||||
import org.alfresco.repo.dictionary.DictionaryComponent;
|
||||
@@ -38,6 +40,9 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ThreadPoolExecutorFactoryBean;
|
||||
import org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry;
|
||||
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -88,7 +93,7 @@ public class MTPolicyComponentTest extends TestCase
|
||||
initNamespaceCaches(namespaceDAO);
|
||||
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(namespaceDAO);
|
||||
dictionaryDAO.setTenantService(mockTenantService);
|
||||
initDictionaryCaches(dictionaryDAO);
|
||||
initDictionaryCaches(dictionaryDAO, mockTenantService);
|
||||
|
||||
DictionaryBootstrap bootstrap = new DictionaryBootstrap();
|
||||
List<String> bootstrapModels = new ArrayList<String>();
|
||||
@@ -110,10 +115,17 @@ public class MTPolicyComponentTest extends TestCase
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO)
|
||||
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception
|
||||
{
|
||||
// note: unit tested here with null cache
|
||||
dictionaryDAO.setDictionaryRegistryCache(new NullCache());
|
||||
CompiledModelsCache compiledModelsCache = new CompiledModelsCache();
|
||||
compiledModelsCache.setDictionaryDAO(dictionaryDAO);
|
||||
compiledModelsCache.setTenantService(tenantService);
|
||||
compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry());
|
||||
ThreadPoolExecutorFactoryBean threadPoolfactory = new ThreadPoolExecutorFactoryBean();
|
||||
threadPoolfactory.afterPropertiesSet();
|
||||
compiledModelsCache.setThreadPoolExecutor((ThreadPoolExecutor) threadPoolfactory.getObject());
|
||||
dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache);
|
||||
dictionaryDAO.init();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -121,6 +133,7 @@ public class MTPolicyComponentTest extends TestCase
|
||||
{
|
||||
// note: unit tested here with null cache
|
||||
namespaceDAO.setNamespaceRegistryCache(new NullCache());
|
||||
namespaceDAO.init();
|
||||
}
|
||||
|
||||
public void testJavaBehaviour()
|
||||
|
Reference in New Issue
Block a user