diff --git a/source/test-java/org/alfresco/repo/dictionary/TestModel.java b/source/java/org/alfresco/repo/dictionary/TestModel.java similarity index 80% rename from source/test-java/org/alfresco/repo/dictionary/TestModel.java rename to source/java/org/alfresco/repo/dictionary/TestModel.java index f8c7211dc5..5eeab22062 100644 --- a/source/test-java/org/alfresco/repo/dictionary/TestModel.java +++ b/source/java/org/alfresco/repo/dictionary/TestModel.java @@ -21,8 +21,10 @@ package org.alfresco.repo.dictionary; import java.util.ArrayList; import java.util.List; -import org.alfresco.repo.cache.DefaultSimpleCache; -import org.alfresco.repo.cache.SimpleCache; +import net.sf.ehcache.Cache; +import net.sf.ehcache.CacheManager; + +import org.alfresco.repo.cache.EhCacheAdapter; import org.alfresco.repo.dictionary.DictionaryDAOImpl.DictionaryRegistry; import org.alfresco.repo.dictionary.NamespaceDAOImpl.NamespaceRegistry; import org.alfresco.repo.tenant.SingleTServiceImpl; @@ -118,13 +120,25 @@ public class TestModel private static void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO) { - SimpleCache dictionaryCache = new DefaultSimpleCache(); + CacheManager cacheManager = new CacheManager(); + + Cache dictionaryEhCache = new Cache("dictionaryCache", 50, false, true, 0L, 0L); + cacheManager.addCache(dictionaryEhCache); + EhCacheAdapter dictionaryCache = new EhCacheAdapter(); + dictionaryCache.setCache(dictionaryEhCache); + dictionaryDAO.setDictionaryRegistryCache(dictionaryCache); } private static void initNamespaceCaches(NamespaceDAOImpl namespaceDAO) { - SimpleCache namespaceCache = new DefaultSimpleCache(); + CacheManager cacheManager = new CacheManager(); + + Cache namespaceEhCache = new Cache("namespaceCache", 50, false, true, 0L, 0L); + cacheManager.addCache(namespaceEhCache); + EhCacheAdapter namespaceCache = new EhCacheAdapter(); + namespaceCache.setCache(namespaceEhCache); + namespaceDAO.setNamespaceRegistryCache(namespaceCache); } } \ No newline at end of file