mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
77150: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 73977: ACE-1802 "MT / Cloud Restrict namespace URI of dynamic models." ACE-955 "Custom Content Models in Cloud" git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78008 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,7 +29,7 @@ import org.alfresco.opencmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.opencmis.mapping.CMISMapping;
|
||||
import org.alfresco.opencmis.search.CMISQueryService;
|
||||
import org.alfresco.repo.dictionary.DictionaryDAO;
|
||||
import org.alfresco.repo.dictionary.NamespaceDAOImpl;
|
||||
import org.alfresco.repo.dictionary.NamespaceDAO;
|
||||
import org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexer;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -105,7 +105,7 @@ public abstract class BaseCMISTest extends TestCase
|
||||
|
||||
protected DictionaryDAO dictionaryDAO;
|
||||
|
||||
protected NamespaceDAOImpl namespaceDao;
|
||||
protected NamespaceDAO namespaceDao;
|
||||
|
||||
protected VersionService versionService;
|
||||
|
||||
@@ -145,7 +145,7 @@ public abstract class BaseCMISTest extends TestCase
|
||||
permissionModelDao = (ModelDAO) ctx.getBean("permissionsModelDAO");
|
||||
|
||||
dictionaryDAO = (DictionaryDAO) ctx.getBean("dictionaryDAO");
|
||||
namespaceDao = (NamespaceDAOImpl) ctx.getBean("namespaceDAO");
|
||||
namespaceDao = (NamespaceDAO) ctx.getBean("namespaceDAO");
|
||||
luceneFTS = (FullTextSearchIndexer)ctx.getBean("LuceneFullTextSearchIndexer");
|
||||
|
||||
testTX = transactionService.getUserTransaction();
|
||||
|
@@ -0,0 +1,68 @@
|
||||
package org.alfresco.opencmis;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import org.alfresco.opencmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
|
||||
import org.alfresco.repo.dictionary.DictionaryDAO;
|
||||
import org.alfresco.repo.dictionary.M2Model;
|
||||
import org.alfresco.repo.tenant.TenantUtil;
|
||||
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations={"classpath:alfresco/application-context.xml"})
|
||||
public class CMISDictionaryTest
|
||||
{
|
||||
private DictionaryDAO dictionaryDAO;
|
||||
private CMISDictionaryService cmisDictionaryService;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Before
|
||||
public void before()
|
||||
{
|
||||
this.dictionaryDAO = (DictionaryDAO)applicationContext.getBean("dictionaryDAO");
|
||||
this.cmisDictionaryService = (CMISDictionaryService)applicationContext.getBean("OpenCMISDictionaryService1.1");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test1()
|
||||
{
|
||||
TenantUtil.runAsUserTenant(new TenantRunAsWork<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
M2Model customModel = M2Model.createModel(
|
||||
Thread.currentThread().getContextClassLoader().
|
||||
getResourceAsStream("dictionary/dictionarydaotest_model1.xml"));
|
||||
dictionaryDAO.putModel(customModel);
|
||||
assertNotNull(cmisDictionaryService.findType("P:cm:dublincore"));
|
||||
TypeDefinitionWrapper td = cmisDictionaryService.findType("D:daotest1:type1");
|
||||
assertNotNull(td);
|
||||
return null;
|
||||
}
|
||||
}, "user1", "tenant1");
|
||||
|
||||
TenantUtil.runAsUserTenant(new TenantRunAsWork<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
assertNotNull(cmisDictionaryService.findType("P:cm:dublincore"));
|
||||
TypeDefinitionWrapper td = cmisDictionaryService.findType("D:daotest1:type1");
|
||||
assertNull(td);
|
||||
return null;
|
||||
}
|
||||
}, "user2", "tenant2");
|
||||
}
|
||||
}
|
@@ -201,7 +201,7 @@ public class CMISTest
|
||||
}
|
||||
}
|
||||
|
||||
private static class SimpleCallContext implements CallContext
|
||||
public static class SimpleCallContext implements CallContext
|
||||
{
|
||||
private final Map<String, Object> contextMap = new HashMap<String, Object>();
|
||||
private CmisVersion cmisVersion;
|
||||
|
Reference in New Issue
Block a user