diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/RMSitesImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/RMSitesImpl.java index 273fba6538..cd2c4630c2 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/RMSitesImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/RMSitesImpl.java @@ -79,6 +79,9 @@ public class RMSitesImpl extends SitesImpl implements RMSites return new RMSite(site, compliance); } + /** + * TODO remove when upgrading to 5.2.N. We'll need to only extend the extended method createSite(Site) and use the siteService method that gets site type as parameter + */ @Override public Site createSite(Site site, Parameters parameters) { @@ -125,6 +128,8 @@ public class RMSitesImpl extends SitesImpl implements RMSites /** * Copied from SitesImpl since we didn't had access to it. * + * TODO to remove when upgrading to 5.2.N + * * @param siteInfo * @param includeRole * @return @@ -142,7 +147,9 @@ public class RMSitesImpl extends SitesImpl implements RMSites } /** - * Copied from SitesImpl since we didn't had access to it + * Copied from SitesImpl since we didn't had access to it. + * + * TODO to be removed when upgrading to 5.2.N * * @param siteId * @param siteNodeRef @@ -193,6 +200,8 @@ public class RMSitesImpl extends SitesImpl implements RMSites /** * This method is copied from SitesImpl since we could not access it since it is private. * + * TODO change this to protected and override validate method from core when upgrading to 5.2.N + * * Even if the method it will be protected in core, we still need to override since we don't need to check if the visibility is set since for RM site it is always PUBLIC. * We also don't need to generate the id from title, or to check the id, since the id is always rm. * @param site diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3341Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3341Test.java index a65ce84be5..e729e9ac7a 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3341Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3341Test.java @@ -27,14 +27,13 @@ */ package org.alfresco.module.org_alfresco_module_rm.test.integration.issue; -import org.alfresco.error.AlfrescoRuntimeException; +import java.security.InvalidParameterException; + import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; -import org.alfresco.service.cmr.model.FileInfo; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.security.AccessStatus; -import org.springframework.extensions.surf.util.I18NUtil; /** * Unit test for RM-3341 .. can copy to hold and transfer folder @@ -43,9 +42,6 @@ import org.springframework.extensions.surf.util.I18NUtil; */ public class RM3341Test extends BaseRMTestCase { - - private final static String MSG_ERROR_ADD_CONTENT_CONTAINER = "rm.service.error-add-content-container"; - public void testCopyingContentsInHoldandTransfer() throws Exception { doTestInTransaction(new Test() @@ -79,13 +75,12 @@ public class RM3341Test extends BaseRMTestCase try { - FileInfo copyInfo = fileFolderService.create(holdContainer, "test file", ContentModel.TYPE_CONTENT); + fileFolderService.create(holdContainer, "test file", ContentModel.TYPE_CONTENT); fail("This should have thrown an exception"); } - catch (AlfrescoRuntimeException e) + catch (InvalidParameterException e) { - // ("Content can't be added to a record container. Use record folders to file content.") - assertEquals(I18NUtil.getMessage(MSG_ERROR_ADD_CONTENT_CONTAINER), e.getMsgId()); + // ("Content can't be added to a hold container. Use record folders to file content.") } return null; } @@ -109,10 +104,9 @@ public class RM3341Test extends BaseRMTestCase fail("This should have thrown an exception"); } - catch (AlfrescoRuntimeException e) + catch (InvalidParameterException e) { - // ("Content can't be added to a record container. Use record folders to file content.") - assertEquals(I18NUtil.getMessage(MSG_ERROR_ADD_CONTENT_CONTAINER), e.getMsgId()); + // ("Content can't be added to a transfer container. Use record folders to file content.") } return null; } diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3450Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3450Test.java index 6c325ab290..02ff9dd758 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3450Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3450Test.java @@ -26,7 +26,8 @@ */ package org.alfresco.module.org_alfresco_module_rm.test.integration.issue; -import org.alfresco.error.AlfrescoRuntimeException; +import java.security.InvalidParameterException; + import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; import org.alfresco.module.org_alfresco_module_rm.test.util.TestModel; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; @@ -48,8 +49,8 @@ public class RM3450Test extends BaseRMTestCase { doTestInTransaction(new FailureTest ( - I18NUtil.getMessage(MSG_CANNOT_CAST_TO_RM_TYPE), - AlfrescoRuntimeException.class + I18NUtil.getMessage(MSG_CANNOT_CAST_TO_RM_TYPE), + InvalidParameterException.class ) { @Override @@ -64,7 +65,7 @@ public class RM3450Test extends BaseRMTestCase } }, false, true); } - }, ADMIN_USER); + }, ADMIN_USER); } }