mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Attempt to work around some of the issues associated with ALF-19155 (MT deleteTenant does not work)
- Currently MT's deleteTenant should be regarded as incomplete and avoided git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@52032 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -34,14 +34,10 @@ import org.alfresco.query.PagingRequest;
|
|||||||
import org.alfresco.query.PagingResults;
|
import org.alfresco.query.PagingResults;
|
||||||
import org.alfresco.repo.policy.BehaviourFilter;
|
import org.alfresco.repo.policy.BehaviourFilter;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
|
||||||
import org.alfresco.repo.site.SiteModel;
|
import org.alfresco.repo.site.SiteModel;
|
||||||
import org.alfresco.repo.tenant.TenantAdminService;
|
import org.alfresco.repo.tenant.TenantAdminService;
|
||||||
import org.alfresco.repo.tenant.TenantUtil;
|
|
||||||
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
|
||||||
import org.alfresco.service.cmr.discussion.DiscussionService;
|
import org.alfresco.service.cmr.discussion.DiscussionService;
|
||||||
import org.alfresco.service.cmr.discussion.PostInfo;
|
import org.alfresco.service.cmr.discussion.PostInfo;
|
||||||
import org.alfresco.service.cmr.discussion.PostWithReplies;
|
import org.alfresco.service.cmr.discussion.PostWithReplies;
|
||||||
@@ -83,7 +79,6 @@ public class DiscussionServiceImplTest
|
|||||||
// injected services
|
// injected services
|
||||||
private static MutableAuthenticationService AUTHENTICATION_SERVICE;
|
private static MutableAuthenticationService AUTHENTICATION_SERVICE;
|
||||||
private static BehaviourFilter BEHAVIOUR_FILTER;
|
private static BehaviourFilter BEHAVIOUR_FILTER;
|
||||||
private static DictionaryService DICTIONARY_SERVICE;
|
|
||||||
private static DiscussionService DISCUSSION_SERVICE;
|
private static DiscussionService DISCUSSION_SERVICE;
|
||||||
private static NodeService NODE_SERVICE;
|
private static NodeService NODE_SERVICE;
|
||||||
private static NodeService PUBLIC_NODE_SERVICE;
|
private static NodeService PUBLIC_NODE_SERVICE;
|
||||||
@@ -117,7 +112,6 @@ public class DiscussionServiceImplTest
|
|||||||
AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
|
AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
|
||||||
BEHAVIOUR_FILTER = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
|
BEHAVIOUR_FILTER = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
|
||||||
DISCUSSION_SERVICE = (DiscussionService)testContext.getBean("DiscussionService");
|
DISCUSSION_SERVICE = (DiscussionService)testContext.getBean("DiscussionService");
|
||||||
DICTIONARY_SERVICE = (DictionaryService)testContext.getBean("dictionaryService");
|
|
||||||
NODE_SERVICE = (NodeService)testContext.getBean("nodeService");
|
NODE_SERVICE = (NodeService)testContext.getBean("nodeService");
|
||||||
PUBLIC_NODE_SERVICE = (NodeService)testContext.getBean("NodeService");
|
PUBLIC_NODE_SERVICE = (NodeService)testContext.getBean("NodeService");
|
||||||
PERSON_SERVICE = (PersonService)testContext.getBean("personService");
|
PERSON_SERVICE = (PersonService)testContext.getBean("personService");
|
||||||
@@ -1900,8 +1894,14 @@ public class DiscussionServiceImplTest
|
|||||||
@Override
|
@Override
|
||||||
public Void execute() throws Throwable
|
public Void execute() throws Throwable
|
||||||
{
|
{
|
||||||
TENANT_ADMIN_SERVICE.deleteTenant(TENANT_DOMAIN);
|
// TODO: WARNING: HACK for ALF-19155: MT deleteTenant does not work
|
||||||
return null;
|
// MultiTNodeServiceInterceptor.exists does not work is tenant has been deleted.
|
||||||
|
// beforeCommit code breaks on NodeService.exists calls
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// TENANT_ADMIN_SERVICE.deleteTenant(TENANT_DOMAIN);
|
||||||
|
// return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -43,6 +43,8 @@ import org.alfresco.repo.model.Repository;
|
|||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||||
import org.alfresco.repo.node.archive.RestoreNodeReport;
|
import org.alfresco.repo.node.archive.RestoreNodeReport;
|
||||||
import org.alfresco.repo.node.index.FullIndexRecoveryComponent;
|
import org.alfresco.repo.node.index.FullIndexRecoveryComponent;
|
||||||
|
import org.alfresco.repo.node.index.IndexTransactionTracker;
|
||||||
|
import org.alfresco.repo.policy.BehaviourFilter;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
import org.alfresco.repo.security.permissions.impl.AccessPermissionImpl;
|
import org.alfresco.repo.security.permissions.impl.AccessPermissionImpl;
|
||||||
@@ -252,6 +254,12 @@ public class MultiTDemoTest extends TestCase
|
|||||||
{
|
{
|
||||||
if (tenantAdminService.existsTenant(tenantDomain))
|
if (tenantAdminService.existsTenant(tenantDomain))
|
||||||
{
|
{
|
||||||
|
// TODO: WARNING: HACK for ALF-19155: MT deleteTenant does not work
|
||||||
|
// PersonService prevents 'guest' authorities from being deleted
|
||||||
|
{
|
||||||
|
BehaviourFilter behaviourFilter = (BehaviourFilter) ctx.getBean("policyBehaviourFilter");
|
||||||
|
behaviourFilter.disableBehaviour(ContentModel.TYPE_PERSON);
|
||||||
|
}
|
||||||
tenantAdminService.deleteTenant(tenantDomain);
|
tenantAdminService.deleteTenant(tenantDomain);
|
||||||
|
|
||||||
logger.info("Deleted tenant " + tenantDomain);
|
logger.info("Deleted tenant " + tenantDomain);
|
||||||
|
Reference in New Issue
Block a user