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

108044: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud)
      107731: Merged 5.0.2 (5.0.2) to 5.0.N (5.0.3)
         107679: MNT-13820 "Model can be deactivated with a node referencing the model is in trashcan"
         Use the database to check if model is in use, rather than Search
         Fix up existing tests in light of these changes


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@108075 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-07-09 22:12:29 +00:00
parent 0b09d68864
commit 62d972f622
20 changed files with 1055 additions and 337 deletions

View File

@@ -33,11 +33,9 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.dictionary.DictionaryDAO;
import org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap;
import org.alfresco.repo.dictionary.ModelValidatorImpl;
import org.alfresco.repo.dictionary.RepositoryLocation;
import org.alfresco.repo.i18n.MessageService;
import org.alfresco.repo.model.Repository;
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.alfresco.repo.security.permissions.PermissionServiceSPI;
@@ -140,9 +138,7 @@ public class ScriptNodeTest
private static TenantAdminService TENANT_ADMIN_SERVICE;
private static MessageService MESSAGE_SERVICE;
private static TransactionService TRANSACTION_SERVICE;
private static ModelValidatorImpl MODEL_VALIDATOR;
private static PolicyComponent POLICY_COMPONENT;
private static TestSiteAndMemberInfo USER_ONES_TEST_SITE;
private static NodeRef USER_ONES_TEST_FILE;
@@ -179,9 +175,7 @@ public class ScriptNodeTest
TENANT_ADMIN_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("tenantAdminService", TenantAdminService.class);
MESSAGE_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("messageService", MessageService.class);
TRANSACTION_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("transactionComponent", TransactionService.class);
MODEL_VALIDATOR = APP_CONTEXT_INIT.getApplicationContext().getBean("modelValidator", ModelValidatorImpl.class);
POLICY_COMPONENT = APP_CONTEXT_INIT.getApplicationContext().getBean("policyComponent", PolicyComponent.class);
USER_ONES_TEST_SITE = STATIC_TEST_SITES.createTestSiteWithUserPerRole(GUID.generate(), "sitePreset", SiteVisibility.PRIVATE, USER_ONE_NAME);
USER_ONES_TEST_FILE = STATIC_TEST_NODES.createQuickFile(MimetypeMap.MIMETYPE_TEXT_PLAIN, USER_ONES_TEST_SITE.doclib, "test.txt", USER_ONE_NAME);
}
@@ -222,11 +216,6 @@ public class ScriptNodeTest
bootstrap.setNodeService(NODE_SERVICE);
bootstrap.setNamespaceService(NAMESPACE_SERVICE);
bootstrap.setMessageService(MESSAGE_SERVICE);
bootstrap.setPolicyComponent(POLICY_COMPONENT);
List<String> storeUrlsToValidate = new ArrayList<String>(1);
storeUrlsToValidate.add(this.storeRef.toString());
MODEL_VALIDATOR.setStoreUrls(storeUrlsToValidate);
RepositoryLocation location = new RepositoryLocation();
location.setStoreProtocol(storeRef.getProtocol());
@@ -250,10 +239,6 @@ public class ScriptNodeTest
{
bootstrap.destroy();
List<String> storeUrlsToValidate = new ArrayList<String>(1);
storeUrlsToValidate.add(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE.toString());
MODEL_VALIDATOR.setStoreUrls(storeUrlsToValidate);
RepositoryLocation location = new RepositoryLocation();
location.setStoreProtocol(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE.getProtocol());
location.setStoreId(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE.getIdentifier());