From e1b24791be67d615a2b2bb69afc6d460106df697 Mon Sep 17 00:00:00 2001 From: Elena Hardon Date: Wed, 14 Feb 2018 16:18:53 +0200 Subject: [PATCH 1/9] RM-19114: Removed the condition on creating only 2 folder-types from root and modified the unit test that was checking this (cherry picked from commit af108af09125ed3da3e6ff6673434c3b045469a2) # Conflicts: # rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java # rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteTypeUnitTest.java --- .../model/rma/type/RmSiteType.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java index 412a8a64ad..e8b3858218 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java @@ -314,7 +314,8 @@ public class RmSiteType extends BaseBehaviourBean /** * Add the limitation of creating only one rma:filePlan or one dod:filePlan depending on the type of rm site. - * Also added the limitation of crating two cm:folder type under rm site. + * Let multiple cm:folder type be created under rm site. + * * Other than this nothing can be created under rm site nodeRef * * @author Silviu Dinuta @@ -342,21 +343,15 @@ public class RmSiteType extends BaseBehaviourBean } /** - * Overridden this because in this case we need to have multiple cm:folder types but not more than two of them. - * The two mentioned folders are created when rm site is created and one of them is Saved Searches and the other surf-config folder. - * After that creation of cm:folder should not be allowed under rm site node + * Overridden this because in this case we need to have multiple cm:folder types. + * The two mentioned folders are created when rm site is created and those are Saved Searches and surf-config folder. + * */ @Override protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List acceptedUniqueChildType, List acceptedMultipleChildType) throws IntegrityException { super.validateNewChildAssociation(parent, child, acceptedUniqueChildType, acceptedMultipleChildType); - - // check the user is not trying to create more than 2 folders that are created by default. - if (nodeService.getChildAssocs(parent, Sets.newHashSet(ContentModel.TYPE_FOLDER)).size() > 2) - { - throw new IntegrityException(I18NUtil.getMessage(MULTIPLE_CHILDREN_TYPE_ERROR, ContentModel.TYPE_FOLDER), null); - } } @Behaviour(kind = BehaviourKind.CLASS, From 0da89c011c76df36100b88b86a00b0afa9541ebe Mon Sep 17 00:00:00 2001 From: Elena Hardon Date: Fri, 16 Feb 2018 16:07:18 +0200 Subject: [PATCH 2/9] MNT-19114 - Added integration test which shows that wiki pages can now be created as immediate folder type children under RM site --- .../test/integration/issue/RM19114Test.java | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java new file mode 100644 index 0000000000..4f25425329 --- /dev/null +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java @@ -0,0 +1,134 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.module.org_alfresco_module_rm.test.integration.issue; + +import static org.alfresco.repo.site.SiteServiceImpl.getSiteContainer; +import static org.alfresco.util.GUID.generate; + +import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.site.SiteInfo; +import org.alfresco.service.cmr.site.SiteVisibility; + +/** + * Test class for RM 19114, wiki page can not be created under RM site + */ +public class RM19114Test extends BaseRMTestCase +{ + public static final String PARENT_NODE = "RMSite"; + public static final String DOCUMENT_LIBRARY_FOLDER_TYPE = "documentLibrary"; + public static final String SURF_CONFIG_FOLDER_TYPE = "surfConfigFolder"; + public static final String WIKI_PAGE_FOLDER_TYPE = "wikiPage"; + + @Override + protected boolean isRMSiteTest() + { + return true; + } + + /** + * Given a RM site and two folder type children + * When creating a third folder type child as a Wiki page + * The page will be created and no exception will be thrown. + */ + public void testCreateWikiPageInRmSite() throws Exception + { + doBehaviourDrivenTest(new BehaviourDrivenTest(null, false) + { + NodeRef wikiPage; + + public void given() + { + doTestInTransaction(new VoidTest() + { + public void runImpl() throws Exception + { + // Creating a Records Management site + SiteInfo rmSite= siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE); + + // Adding two immediate folder type children + getSiteContainer( + PARENT_NODE, + DOCUMENT_LIBRARY_FOLDER_TYPE, + true, + siteService, + transactionService, + taggingService); + getSiteContainer( + PARENT_NODE, + SURF_CONFIG_FOLDER_TYPE, + true, + siteService, + transactionService, + taggingService); + } + }); + } + + public void when() throws Exception + { + doTestInTransaction(new VoidTest() + { + public void runImpl() throws Exception + { + wikiPage = getSiteContainer( + PARENT_NODE, + WIKI_PAGE_FOLDER_TYPE, + true, + siteService, + transactionService, + taggingService); + } + + }); + } + + public void then() throws Exception + { + doTestInTransaction(new VoidTest() + { + public void runImpl() throws Exception + { + System.out.println(nodeService.getChildAssocs(wikiPage)); + System.out.println(nodeService.getProperties(wikiPage)); + + assertEquals( true, nodeService.exists(wikiPage)); + } + }); + + } + + public void after(){ + doTestInTransaction(new VoidTest() + { + public void runImpl() throws Exception + { + siteService.deleteSite(PARENT_NODE);}}); + } + }); + } +} From b581d587260e5b2250b5eb4299bc1e3bb51ebbfa Mon Sep 17 00:00:00 2001 From: Elena Hardon Date: Fri, 16 Feb 2018 16:08:18 +0200 Subject: [PATCH 3/9] MNT-19114: Removed unused comments --- .../test/integration/issue/RM19114Test.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java index 4f25425329..c1f9745aaf 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java @@ -113,9 +113,6 @@ public class RM19114Test extends BaseRMTestCase { public void runImpl() throws Exception { - System.out.println(nodeService.getChildAssocs(wikiPage)); - System.out.println(nodeService.getProperties(wikiPage)); - assertEquals( true, nodeService.exists(wikiPage)); } }); From f1e3c0b8533f512327a478099855f8a756e9225c Mon Sep 17 00:00:00 2001 From: Elena Hardon Date: Mon, 19 Feb 2018 13:40:52 +0200 Subject: [PATCH 4/9] MNT-19114 - Made review changes --- .../model/rma/type/RmSiteType.java | 16 +--- .../{RM19114Test.java => MNT19114Test.java} | 86 +++++++------------ 2 files changed, 34 insertions(+), 68 deletions(-) rename rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/{RM19114Test.java => MNT19114Test.java} (50%) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java index e8b3858218..0682bf28b1 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java @@ -27,20 +27,19 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; -import com.google.common.collect.Sets; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean; import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService; import org.alfresco.repo.node.NodeServicePolicies; -import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.repo.policy.Behaviour.NotificationFrequency; import org.alfresco.repo.policy.annotation.Behaviour; import org.alfresco.repo.policy.annotation.BehaviourBean; @@ -59,7 +58,6 @@ import org.alfresco.service.cmr.site.SiteVisibility; import org.alfresco.service.namespace.QName; import org.alfresco.util.ParameterCheck; import org.alfresco.util.PropertyMap; -import org.springframework.extensions.surf.util.I18NUtil; /** * Behaviour associated with the RM Site type @@ -342,18 +340,6 @@ public class RmSiteType extends BaseBehaviourBean }); } - /** - * Overridden this because in this case we need to have multiple cm:folder types. - * The two mentioned folders are created when rm site is created and those are Saved Searches and surf-config folder. - * - */ - @Override - protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List acceptedUniqueChildType, - List acceptedMultipleChildType) throws IntegrityException - { - super.validateNewChildAssociation(parent, child, acceptedUniqueChildType, acceptedMultipleChildType); - } - @Behaviour(kind = BehaviourKind.CLASS, policy = "alf:onDeleteNode", notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT) diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/MNT19114Test.java similarity index 50% rename from rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java rename to rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/MNT19114Test.java index c1f9745aaf..a502b01e82 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM19114Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/MNT19114Test.java @@ -35,9 +35,9 @@ import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteVisibility; /** - * Test class for RM 19114, wiki page can not be created under RM site + * Test class for MNT 19114, wiki page can not be created under RM site */ -public class RM19114Test extends BaseRMTestCase +public class MNT19114Test extends BaseRMTestCase { public static final String PARENT_NODE = "RMSite"; public static final String DOCUMENT_LIBRARY_FOLDER_TYPE = "documentLibrary"; @@ -57,74 +57,54 @@ public class RM19114Test extends BaseRMTestCase */ public void testCreateWikiPageInRmSite() throws Exception { - doBehaviourDrivenTest(new BehaviourDrivenTest(null, false) + doBehaviourDrivenTest(new BehaviourDrivenTest() { NodeRef wikiPage; public void given() { - doTestInTransaction(new VoidTest() - { - public void runImpl() throws Exception - { - // Creating a Records Management site - SiteInfo rmSite= siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE); + // Creating a Records Management site + siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE); - // Adding two immediate folder type children - getSiteContainer( - PARENT_NODE, - DOCUMENT_LIBRARY_FOLDER_TYPE, - true, - siteService, - transactionService, - taggingService); - getSiteContainer( - PARENT_NODE, - SURF_CONFIG_FOLDER_TYPE, - true, - siteService, - transactionService, - taggingService); - } - }); + // Adding two immediate folder type children + getSiteContainer( + PARENT_NODE, + DOCUMENT_LIBRARY_FOLDER_TYPE, + true, + siteService, + transactionService, + taggingService); + getSiteContainer( + PARENT_NODE, + SURF_CONFIG_FOLDER_TYPE, + true, + siteService, + transactionService, + taggingService); } public void when() throws Exception { - doTestInTransaction(new VoidTest() - { - public void runImpl() throws Exception - { - wikiPage = getSiteContainer( - PARENT_NODE, - WIKI_PAGE_FOLDER_TYPE, - true, - siteService, - transactionService, - taggingService); - } - }); + wikiPage = getSiteContainer( + PARENT_NODE, + WIKI_PAGE_FOLDER_TYPE, + true, + siteService, + transactionService, + taggingService); + } public void then() throws Exception { - doTestInTransaction(new VoidTest() - { - public void runImpl() throws Exception - { - assertEquals( true, nodeService.exists(wikiPage)); - } - }); - + // Check if the new folder type wiki page has been created + assertEquals(true, nodeService.exists(wikiPage)); } - public void after(){ - doTestInTransaction(new VoidTest() - { - public void runImpl() throws Exception - { - siteService.deleteSite(PARENT_NODE);}}); + public void after() + { + siteService.deleteSite(PARENT_NODE); } }); } From 194928c0daf3952d793e40fe6e00b5d16254dbc2 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Tue, 20 Feb 2018 22:52:34 +0200 Subject: [PATCH 5/9] upgrade the dataPrep dependency add a simple test to cover create wiki page issue (MNT-19117) --- rm-automation/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 8b6b5481f5..21ad79cc3e 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -108,7 +108,7 @@ org.alfresco.test dataprep - 1.25 + 1.30 org.alfresco.test From 1fe8242944f9db4631f348d751fc5f2fc6fb5fe8 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Wed, 21 Feb 2018 22:57:16 +0200 Subject: [PATCH 6/9] attempt (2) to fix running the test methods in different classes interleaved --- rm-automation/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 8b6b5481f5..87481be804 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -150,7 +150,7 @@ org.testng testng - 6.8.8 + 6.13.1 ru.yandex.qatools.htmlelements From bada7c2438cb67645eef16948bcc523cb791f24a Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Thu, 22 Feb 2018 23:09:08 +0200 Subject: [PATCH 7/9] another attempt to fix running the test execution order --- rm-automation/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index a8ad07df78..5a8bf4d96a 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -150,7 +150,7 @@ org.testng testng - 6.13.1 + 6.9.10 ru.yandex.qatools.htmlelements From ec18a96609ed03bb490d272cfe31d923d73894b1 Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Mon, 26 Feb 2018 15:02:26 +0000 Subject: [PATCH 8/9] [maven-release-plugin] prepare release V2.5.3 --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index d1cdf9f98d..f5d7cf67ea 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-rm pom - 2.5.3-SNAPSHOT + 2.5.3 Alfresco Records Management @@ -24,7 +24,7 @@ scm:git:https://git.alfresco.com/records-management/records-management.git scm:git:https://git.alfresco.com/records-management/records-management.git https://git.alfresco.com/records-management/records-management - HEAD + V2.5.3 diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 5a8bf4d96a..6e2d649537 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.5.3-SNAPSHOT + 2.5.3 diff --git a/rm-community/pom.xml b/rm-community/pom.xml index 1e3cc7ce3c..b26b26c097 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.5.3-SNAPSHOT + 2.5.3 diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 303cc53076..64b71ea9db 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-rm-community - 2.5.3-SNAPSHOT + 2.5.3 From 9385959ed9f65f1fb6bad7a0f8bfed41adcd3cd9 Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Mon, 26 Feb 2018 15:02:28 +0000 Subject: [PATCH 9/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index f5d7cf67ea..b4e02eb494 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-rm pom - 2.5.3 + 2.5.4-SNAPSHOT Alfresco Records Management @@ -24,7 +24,7 @@ scm:git:https://git.alfresco.com/records-management/records-management.git scm:git:https://git.alfresco.com/records-management/records-management.git https://git.alfresco.com/records-management/records-management - V2.5.3 + HEAD diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 6e2d649537..2d86518bce 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.5.3 + 2.5.4-SNAPSHOT diff --git a/rm-community/pom.xml b/rm-community/pom.xml index b26b26c097..dcb26c4f0d 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.5.3 + 2.5.4-SNAPSHOT diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 64b71ea9db..e5f716681e 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-rm-community - 2.5.3 + 2.5.4-SNAPSHOT