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:
Mark Rogers
2014-07-23 15:52:36 +00:00
parent 4433cb3850
commit 0bc9e57640

View File

@@ -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<String, NamespaceRegistry>());
namespaceDAO.init();
dictionaryDAO = new DictionaryDAOImpl(namespaceDAO);
dictionaryDAO.setTenantService(tenantService);
dictionaryDAO.setDictionaryRegistryCache(new MemoryCache<String, DictionaryRegistry>());
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);