Merged BRANCHES/DEV/V4.1-BUG-FIX to HEAD:

41618: MT: ALF-14354 - Repository.getRootHome() is not tenant-safe !!


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@41620 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2012-09-14 15:44:23 +00:00
parent 6ec5fe4f27
commit 2b8870c772
2 changed files with 64 additions and 13 deletions

View File

@@ -1280,6 +1280,41 @@ public class MultiTDemoTest extends TestCase
}, tenantAdminName);
}
public void test_ALF_14354()
{
final String tenantDomain1 = TEST_RUN+".one.alf14354";
final String tenantDomain2 = TEST_RUN+".two.alf14354";
createTenant(tenantDomain1);
createTenant(tenantDomain2);
String tenantAdminName = tenantService.getDomainUser(AuthenticationUtil.getAdminUserName(), tenantDomain1);
AuthenticationUtil.runAs(new RunAsWork<Object>()
{
public Object doWork() throws Exception
{
NodeRef rootNodeRef = repositoryHelper.getRootHome();
assertTrue(nodeService.exists(rootNodeRef));
return null;
}
}, tenantAdminName);
tenantAdminName = tenantService.getDomainUser(AuthenticationUtil.getAdminUserName(), tenantDomain2);
AuthenticationUtil.runAs(new RunAsWork<Object>()
{
public Object doWork() throws Exception
{
NodeRef rootNodeRef = repositoryHelper.getRootHome();
assertTrue(nodeService.exists(rootNodeRef));
return null;
}
}, tenantAdminName);
}
private void createGroup(String shortName, String parentShortName)
{
// create new Group using authority Service