Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

77153: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      74000: ACE-1802 "MT / Cloud Restrict namespace URI of dynamic models."
      ACE-955 "Custom Content Models in Cloud"
      fix build


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78011 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-07-23 16:03:28 +00:00
parent 3349e56606
commit 1b4155add7
4 changed files with 12 additions and 66 deletions

View File

@@ -79,10 +79,6 @@ public class TestModel
// construct dictionary dao // construct dictionary dao
TenantService tenantService = new SingleTServiceImpl(); TenantService tenantService = new SingleTServiceImpl();
// NamespaceDAOImpl namespaceDAO = new NamespaceDAOImpl();
// namespaceDAO.setTenantService(tenantService);
// initNamespaceCaches(namespaceDAO);
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(); DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService); dictionaryDAO.setTenantService(tenantService);
@@ -118,10 +114,4 @@ public class TestModel
SimpleCache<String, DictionaryRegistry> dictionaryCache = new DefaultSimpleCache<String, DictionaryRegistry>(); SimpleCache<String, DictionaryRegistry> dictionaryCache = new DefaultSimpleCache<String, DictionaryRegistry>();
dictionaryDAO.setDictionaryRegistryCache(dictionaryCache); dictionaryDAO.setDictionaryRegistryCache(dictionaryCache);
} }
// private static void initNamespaceCaches(NamespaceDAOImpl namespaceDAO)
// {
// SimpleCache<String, NamespaceRegistry> namespaceCache = new DefaultSimpleCache<String, NamespaceRegistry>();
// namespaceDAO.setNamespaceRegistryCache(namespaceCache);
// }
} }

View File

@@ -86,9 +86,6 @@ public class RepoDictionaryDAOTest extends TestCase
// Instantiate Dictionary Service // Instantiate Dictionary Service
TenantService tenantService = new SingleTServiceImpl(); TenantService tenantService = new SingleTServiceImpl();
// NamespaceDAOImpl namespaceDAO = new NamespaceDAOImpl();
// namespaceDAO.setTenantService(tenantService);
// initNamespaceCaches(namespaceDAO);
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(); DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService); dictionaryDAO.setTenantService(tenantService);
@@ -119,19 +116,9 @@ public class RepoDictionaryDAOTest extends TestCase
dictionaryDAO.setDictionaryRegistryCache(dictionaryCache); dictionaryDAO.setDictionaryRegistryCache(dictionaryCache);
} }
// private void initNamespaceCaches(NamespaceDAOImpl namespaceDAO)
// {
// SimpleCache<String, NamespaceRegistry> namespaceCache = new DefaultSimpleCache<String, NamespaceRegistry>(11, getClass().getName() + ".namespace");
// namespaceDAO.setNamespaceRegistryCache(namespaceCache);
// }
public void testBootstrap() public void testBootstrap()
{ {
TenantService tenantService = new SingleTServiceImpl(); TenantService tenantService = new SingleTServiceImpl();
// NamespaceDAOImpl namespaceDAO = new NamespaceDAOImpl();
// namespaceDAO.setTenantService(tenantService);
// initNamespaceCaches(namespaceDAO);
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(); DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService); dictionaryDAO.setTenantService(tenantService);
@@ -416,17 +403,11 @@ public class RepoDictionaryDAOTest extends TestCase
{ {
// source dictionary // source dictionary
TenantService tenantService = new SingleTServiceImpl(); TenantService tenantService = new SingleTServiceImpl();
// NamespaceDAOImpl namespaceDAO = new NamespaceDAOImpl();
// namespaceDAO.setTenantService(tenantService);
// initNamespaceCaches(namespaceDAO);
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(); DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService); dictionaryDAO.setTenantService(tenantService);
initDictionaryCaches(dictionaryDAO); initDictionaryCaches(dictionaryDAO);
// destination dictionary // destination dictionary
// NamespaceDAOImpl namespaceDAO2 = new NamespaceDAOImpl();
// namespaceDAO2.setTenantService(tenantService);
// initNamespaceCaches(namespaceDAO2);
DictionaryDAOImpl dictionaryDAO2 = new DictionaryDAOImpl(); DictionaryDAOImpl dictionaryDAO2 = new DictionaryDAOImpl();
dictionaryDAO2.setTenantService(tenantService); dictionaryDAO2.setTenantService(tenantService);
initDictionaryCaches(dictionaryDAO2); initDictionaryCaches(dictionaryDAO2);

View File

@@ -18,31 +18,27 @@
*/ */
package org.alfresco.repo.policy; package org.alfresco.repo.policy;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.alfresco.repo.cache.NullCache; import org.alfresco.repo.cache.MemoryCache;
import org.alfresco.repo.dictionary.CompiledModel;
import org.alfresco.repo.dictionary.DictionaryBootstrap; import org.alfresco.repo.dictionary.DictionaryBootstrap;
import org.alfresco.repo.dictionary.DictionaryComponent; import org.alfresco.repo.dictionary.DictionaryComponent;
import org.alfresco.repo.dictionary.DictionaryDAOImpl; import org.alfresco.repo.dictionary.DictionaryDAOImpl;
import org.alfresco.repo.dictionary.NamespaceDAOImpl;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.tenant.TenantService; import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef; import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/** /**
* Policy Component Tests * Policy Component Tests
* *
@@ -83,9 +79,6 @@ public class MTPolicyComponentTest extends TestCase
when(mockTenantService.getBaseName(any(StoreRef.class))).thenReturn(new StoreRef(BASE_PROTOCOL, BASE_IDENTIFIER)); when(mockTenantService.getBaseName(any(StoreRef.class))).thenReturn(new StoreRef(BASE_PROTOCOL, BASE_IDENTIFIER));
// NamespaceDAOImpl namespaceDAO = new NamespaceDAOImpl();
// namespaceDAO.setTenantService(mockTenantService);
// initNamespaceCaches(namespaceDAO);
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(); DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(mockTenantService); dictionaryDAO.setTenantService(mockTenantService);
initDictionaryCaches(dictionaryDAO); initDictionaryCaches(dictionaryDAO);
@@ -109,20 +102,13 @@ public class MTPolicyComponentTest extends TestCase
policyComponent = x; policyComponent = x;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "rawtypes" })
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO) private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO)
{ {
// note: unit tested here with null cache // note: unit tested here with null cache
dictionaryDAO.setDictionaryRegistryCache(new NullCache()); dictionaryDAO.setDictionaryRegistryCache(new MemoryCache());
} }
// @SuppressWarnings("unchecked")
// private void initNamespaceCaches(NamespaceDAOImpl namespaceDAO)
// {
// // note: unit tested here with null cache
// namespaceDAO.setNamespaceRegistryCache(new NullCache());
// }
public void testJavaBehaviour() public void testJavaBehaviour()
{ {
Behaviour validBehaviour = new JavaBehaviour(this, "validClassTest"); Behaviour validBehaviour = new JavaBehaviour(this, "validClassTest");

View File

@@ -28,7 +28,6 @@ import org.alfresco.repo.cache.NullCache;
import org.alfresco.repo.dictionary.DictionaryBootstrap; import org.alfresco.repo.dictionary.DictionaryBootstrap;
import org.alfresco.repo.dictionary.DictionaryComponent; import org.alfresco.repo.dictionary.DictionaryComponent;
import org.alfresco.repo.dictionary.DictionaryDAOImpl; import org.alfresco.repo.dictionary.DictionaryDAOImpl;
import org.alfresco.repo.dictionary.NamespaceDAOImpl;
import org.alfresco.repo.tenant.SingleTServiceImpl; import org.alfresco.repo.tenant.SingleTServiceImpl;
import org.alfresco.repo.tenant.TenantService; import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
@@ -57,9 +56,6 @@ public class PolicyComponentTest extends TestCase
{ {
// Instantiate Dictionary Service // Instantiate Dictionary Service
TenantService tenantService = new SingleTServiceImpl(); TenantService tenantService = new SingleTServiceImpl();
// NamespaceDAOImpl namespaceDAO = new NamespaceDAOImpl();
// namespaceDAO.setTenantService(tenantService);
// initNamespaceCaches(namespaceDAO);
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(); DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService); dictionaryDAO.setTenantService(tenantService);
initDictionaryCaches(dictionaryDAO); initDictionaryCaches(dictionaryDAO);
@@ -88,13 +84,6 @@ public class PolicyComponentTest extends TestCase
dictionaryDAO.setDictionaryRegistryCache(new NullCache()); dictionaryDAO.setDictionaryRegistryCache(new NullCache());
} }
// @SuppressWarnings("unchecked")
// private void initNamespaceCaches(NamespaceDAOImpl namespaceDAO)
// {
// // note: unit tested here with null cache
// namespaceDAO.setNamespaceRegistryCache(new NullCache());
// }
public void testJavaBehaviour() public void testJavaBehaviour()
{ {
Behaviour validBehaviour = new JavaBehaviour(this, "validTest"); Behaviour validBehaviour = new JavaBehaviour(this, "validTest");