mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/DEV/V4.1-BUG-FIX to HEAD:
41642: MT: fix unit test/build (ALF-12732) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@41643 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1257,27 +1257,37 @@ public class MultiTDemoTest extends TestCase
|
|||||||
createTenant(tenantDomain1);
|
createTenant(tenantDomain1);
|
||||||
|
|
||||||
String tenantAdminName = tenantService.getDomainUser(AuthenticationUtil.getAdminUserName(), tenantDomain1);
|
String tenantAdminName = tenantService.getDomainUser(AuthenticationUtil.getAdminUserName(), tenantDomain1);
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
public Object doWork() throws Exception
|
AuthenticationUtil.setFullyAuthenticatedUser(tenantAdminName); // note: since SiteServiceImpl.setupSitePermissions currently uses getCurrentUserName (rather than runAs)
|
||||||
|
|
||||||
|
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
createSite("site1");
|
public Object doWork() throws Exception
|
||||||
|
{
|
||||||
NodeRef docLib1Ref = siteService.getContainer("site1", SiteService.DOCUMENT_LIBRARY);
|
createSite("site1");
|
||||||
NodeRef contentRef = addContent(docLib1Ref, "tqbfjotld.txt", "The quick brown fox jumps over the lazy dog", MimetypeMap.MIMETYPE_TEXT_PLAIN);
|
|
||||||
|
NodeRef docLib1Ref = siteService.getContainer("site1", SiteService.DOCUMENT_LIBRARY);
|
||||||
createSite("site2");
|
NodeRef contentRef = addContent(docLib1Ref, "tqbfjotld.txt", "The quick brown fox jumps over the lazy dog", MimetypeMap.MIMETYPE_TEXT_PLAIN);
|
||||||
|
|
||||||
NodeRef docLib2Ref = siteService.getContainer("site2", SiteService.DOCUMENT_LIBRARY);
|
createSite("site2");
|
||||||
|
|
||||||
nodeService.moveNode(contentRef, docLib2Ref, ContentModel.ASSOC_CONTAINS, QName.createQName("tqbfjotld.txt"));
|
NodeRef docLib2Ref = siteService.getContainer("site2", SiteService.DOCUMENT_LIBRARY);
|
||||||
|
|
||||||
// for Share, called via "move-to.post.json.js" -> ScriptSiteService.cleanSitePermissions
|
nodeService.moveNode(contentRef, docLib2Ref, ContentModel.ASSOC_CONTAINS, QName.createQName("tqbfjotld.txt"));
|
||||||
siteService.cleanSitePermissions(contentRef, null);
|
|
||||||
|
// for Share, called via "move-to.post.json.js" -> ScriptSiteService.cleanSitePermissions
|
||||||
return null;
|
siteService.cleanSitePermissions(contentRef, null);
|
||||||
}
|
|
||||||
}, tenantAdminName);
|
return null;
|
||||||
|
}
|
||||||
|
}, tenantAdminName);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
AuthenticationUtil.clearCurrentSecurityContext();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void test_ALF_14354()
|
public void test_ALF_14354()
|
||||||
|
Reference in New Issue
Block a user