From 0bc9e57640036d8f6e332917a1e8c8cbb445efcc Mon Sep 17 00:00:00 2001 From: Mark Rogers Date: Wed, 23 Jul 2014 15:52:36 +0000 Subject: [PATCH] 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 --- .../alfresco/solr/client/SOLRAPIClientTest.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/search-services/alfresco-solrclient-lib/source/test-java/org/alfresco/solr/client/SOLRAPIClientTest.java b/search-services/alfresco-solrclient-lib/source/test-java/org/alfresco/solr/client/SOLRAPIClientTest.java index 471bf5563..158d8ddde 100644 --- a/search-services/alfresco-solrclient-lib/source/test-java/org/alfresco/solr/client/SOLRAPIClientTest.java +++ b/search-services/alfresco-solrclient-lib/source/test-java/org/alfresco/solr/client/SOLRAPIClientTest.java @@ -38,6 +38,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.concurrent.ThreadPoolExecutor; import junit.framework.TestCase; @@ -62,6 +63,7 @@ import org.alfresco.repo.dictionary.DictionaryComponent; import org.alfresco.repo.dictionary.DictionaryDAO; import org.alfresco.repo.dictionary.DictionaryDAOImpl; import org.alfresco.repo.dictionary.DictionaryDAOImpl.DictionaryRegistry; +import org.alfresco.repo.dictionary.CompiledModelsCache; import org.alfresco.repo.dictionary.DictionaryNamespaceComponent; import org.alfresco.repo.dictionary.M2Model; import org.alfresco.repo.dictionary.M2Namespace; @@ -75,6 +77,8 @@ import org.alfresco.service.namespace.NamespaceException; import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.util.Pair; +import org.alfresco.util.ThreadPoolExecutorFactoryBean; +import org.alfresco.util.cache.DefaultAsynchronouslyRefreshedCacheRegistry; import org.apache.chemistry.opencmis.commons.enums.CmisVersion; import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.methods.ByteArrayRequestEntity; @@ -146,13 +150,24 @@ public class SOLRAPIClientTest extends TestCase namespaceDAO = new NamespaceDAOImpl(); namespaceDAO.setTenantService(tenantService); namespaceDAO.setNamespaceRegistryCache(new MemoryCache()); + namespaceDAO.init(); dictionaryDAO = new DictionaryDAOImpl(namespaceDAO); dictionaryDAO.setTenantService(tenantService); - dictionaryDAO.setDictionaryRegistryCache(new MemoryCache()); + + 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); // TODO: use config .... dictionaryDAO.setDefaultAnalyserResourceBundleName("alfresco/model/dataTypeAnalyzers"); dictionaryDAO.setResourceClassLoader(getResourceClassLoader()); + dictionaryDAO.init(); dictionaryComponent = new DictionaryComponent(); dictionaryComponent.setDictionaryDAO(dictionaryDAO);