From 2d5996b91e1a6fd6e05be70c8cca02bdc5ad2469 Mon Sep 17 00:00:00 2001 From: Samuel Langlois Date: Thu, 5 May 2016 15:19:56 +0100 Subject: [PATCH 1/9] RM-3379 Add publicapi profile to filter Javadoc --- pom.xml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/pom.xml b/pom.xml index b3bc599547..02dfc0d634 100644 --- a/pom.xml +++ b/pom.xml @@ -342,4 +342,71 @@ + + + + + publicapi + + 1.6.1 + + + + + com.docflex + docflex-alfresco-license + 1.0 + license + + + + + + + maven-dependency-plugin + 2.10 + + + + default-cli + generate-sources + + unpack + + + + + com.docflex + docflex-javadoc + ${docflex.version} + zip + + + ${project.build.directory} + + + + + + + maven-javadoc-plugin + 2.10.3 + + com.docflex.javadoc.Doclet + ${project.build.directory}/docflex-javadoc-${docflex.version}/lib/docflex-javadoc.jar + + -license ${settings.localRepository}/com/docflex/docflex-alfresco-license/1.0/docflex-alfresco-license-1.0.license + -template ${project.build.directory}/docflex-javadoc-${docflex.version}/templates/JavadocPro/FramedDoc.tpl + -nodialog + -launchviewer=false + -p:filter.byAnns.include.classes=org.alfresco.api.AlfrescoPublicApi + -p:docTitle "${project.name} ${project.version} Public API" + -p:windowTitle "${project.name} ${project.version} Public API" + + + + + + + From b2ac4f89eeeaa1e490570b691326c2815dc93399 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Fri, 1 Sep 2017 13:05:53 +0100 Subject: [PATCH 2/9] RM-5611 Create data setup method for edit with guides tests. Also add a new helper method in BaseTest to create a document in a site and return the noderef. --- .../org/alfresco/rest/core/v0/BaseAPI.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java index 1e88d4be45..74ea1bc661 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java @@ -83,12 +83,12 @@ public abstract class BaseAPI @Autowired private AlfrescoHttpClientFactory alfrescoHttpClientFactory; - @Autowired + @Autowired private ContentService contentService; private static final String NODE_REF_WORKSPACE_SPACES_STORE = "workspace://SpacesStore/"; private static final String FILE_PLAN_PATH = "Sites/rm/documentLibrary"; - + /** * Helper method to extract list of properties values from result. * @@ -404,11 +404,19 @@ public abstract class BaseAPI try { - responseBody = new JSONObject(EntityUtils.toString(response.getEntity())); + String bodyString = EntityUtils.toString(response.getEntity()); + try + { + responseBody = new JSONObject(bodyString); + } + catch (JSONException error) + { + LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error); + } } - catch (ParseException | IOException | JSONException error) + catch (ParseException | IOException error) { - LOGGER.error("Parsing message body failed", error); + LOGGER.error("Parsing message body failed.", error); } switch (response.getStatusLine().getStatusCode()) @@ -616,7 +624,7 @@ public abstract class BaseAPI return getObjectByPath(username, password, itemPath) == null; } - /** + /** * Retrieve the node ref spaces store value * * @return node ref spaces store From 482df8a964f34801e279db5fcb8bda70a08c9c80 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Thu, 7 Sep 2017 10:02:53 +0300 Subject: [PATCH 3/9] update TAS dependency updates for tests for RM-5391(1) --- rm-automation/rm-automation-community-rest-api/pom.xml | 7 ++++++- .../alfresco/rest/rm/community/site/RMSiteTests.java | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index 151b0bcce1..0fc4781ef4 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -15,7 +15,7 @@ 1.8 alfresco-rm-community-share alfresco-rm-community-repo - 5.2.0-7 + 5.2.0-9 2.0.0 @@ -68,5 +68,10 @@ fluent-json ${fluent.json.version} + + org.alfresco.test + alfresco-testng + 1.1 + diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java index 709881d2e4..cc0f560dd5 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java @@ -44,10 +44,10 @@ import static org.springframework.http.HttpStatus.FORBIDDEN; import static org.springframework.http.HttpStatus.NOT_FOUND; import static org.springframework.http.HttpStatus.NO_CONTENT; import static org.springframework.http.HttpStatus.OK; -import static org.springframework.social.alfresco.api.entities.Site.Visibility.PUBLIC; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; +import org.alfresco.dataprep.SiteService.Visibility; import org.alfresco.rest.rm.community.base.BaseRMRestTest; import org.alfresco.rest.rm.community.base.TestData; import org.alfresco.rest.rm.community.model.site.RMSite; @@ -97,7 +97,7 @@ public class RMSiteTests extends BaseRMRestTest assertEquals(rmSiteResponse.getTitle(), RM_TITLE); assertEquals(rmSiteResponse.getDescription(), RM_DESCRIPTION); assertEquals(rmSiteResponse.getCompliance(), STANDARD); - assertEquals(rmSiteResponse.getVisibility(), PUBLIC); + assertEquals(rmSiteResponse.getVisibility(), Visibility.PUBLIC); assertEquals(rmSiteResponse.getRole(), SiteManager.toString()); } @@ -178,7 +178,7 @@ public class RMSiteTests extends BaseRMRestTest assertEquals(rmSiteModel.getId(), RM_ID); assertEquals(rmSiteModel.getDescription(), RM_DESCRIPTION); assertEquals(rmSiteModel.getCompliance(), STANDARD); - assertEquals(rmSiteModel.getVisibility(), PUBLIC); + assertEquals(rmSiteModel.getVisibility(), Visibility.PUBLIC); } } @@ -217,7 +217,7 @@ public class RMSiteTests extends BaseRMRestTest assertEquals(rmSiteModel.getTitle(), RM_TITLE); assertEquals(rmSiteModel.getDescription(), RM_DESCRIPTION); assertEquals(rmSiteModel.getCompliance(), DOD5015); - assertEquals(rmSiteModel.getVisibility(), PUBLIC); + assertEquals(rmSiteModel.getVisibility(), Visibility.PUBLIC); assertEquals(rmSiteModel.getRole(), SiteManager.toString()); } @@ -259,7 +259,7 @@ public class RMSiteTests extends BaseRMRestTest assertEquals(rmSiteModel.getTitle(), NEW_TITLE); assertEquals(rmSiteModel.getDescription(), NEW_DESCRIPTION); assertNotNull(rmSiteModel.getCompliance()); - assertEquals(rmSiteModel.getVisibility(), PUBLIC); + assertEquals(rmSiteModel.getVisibility(), Visibility.PUBLIC); } /** From 105d43659e45bee21469378003ea1597f0059db3 Mon Sep 17 00:00:00 2001 From: Ross Gale Date: Wed, 6 Sep 2017 15:04:37 +0100 Subject: [PATCH 4/9] RM-5612 Changing versions and fixing failing tests --- rm-community/pom.xml | 4 +- .../test/integration/hold/DeleteHoldTest.java | 73 +++++++++++-------- .../test/integration/issue/RM1914Test.java | 57 +++++++-------- .../test/integration/issue/RM4804Test.java | 27 ++++--- .../legacy/service/FreezeServiceImplTest.java | 63 +++++++++++----- 5 files changed, 132 insertions(+), 92 deletions(-) diff --git a/rm-community/pom.xml b/rm-community/pom.xml index 3e968cbb1d..8e9816ba62 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -43,7 +43,7 @@ - 5.2.f - 5.2.e + 5.2.g + 5.2.f diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/hold/DeleteHoldTest.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/hold/DeleteHoldTest.java index 01ee388041..6117658a96 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/hold/DeleteHoldTest.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/hold/DeleteHoldTest.java @@ -91,53 +91,68 @@ public class DeleteHoldTest extends BaseRMTestCase public void testDeleteHoldBehaviourForRecordFolder() { + NodeRef hold1 = doTestInTransaction(new Test() + { + @Override + public NodeRef run() throws Exception + { + // create test holds + return createAndCheckHold(); + } + }); + //Splitting transaction to fix onCreateNodePolicy issue where there was a node not found exception doTestInTransaction(new Test() { - @Override - public Void run() throws Exception - { - // create test holds - NodeRef hold1 = createAndCheckHold(); + @Override + public Void run() throws Exception + { + // add the record folder to hold1 + holdService.addToHold(hold1, rmFolder); - // add the record folder to hold1 - holdService.addToHold(hold1, rmFolder); + // assert that the folder and records are frozen + assertTrue(freezeService.isFrozen(rmFolder)); + assertTrue(freezeService.isFrozen(recordOne)); + assertTrue(freezeService.isFrozen(recordDeclaredOne)); - // assert that the folder and records are frozen - assertTrue(freezeService.isFrozen(rmFolder)); - assertTrue(freezeService.isFrozen(recordOne)); - assertTrue(freezeService.isFrozen(recordDeclaredOne)); + // check the contents of the hold + List frozenNodes = holdService.getHeld(hold1); + assertNotNull(frozenNodes); + assertEquals(1, frozenNodes.size()); + assertEquals(rmFolder, frozenNodes.get(0)); - // check the contents of the hold - List frozenNodes = holdService.getHeld(hold1); - assertNotNull(frozenNodes); - assertEquals(1, frozenNodes.size()); - assertEquals(rmFolder, frozenNodes.get(0)); + // delete the hold + holdService.deleteHold(hold1); - // delete the hold - holdService.deleteHold(hold1); + // assert that the folder and records no longer frozen + assertFalse(freezeService.isFrozen(rmFolder)); + assertFalse(freezeService.isFrozen(recordOne)); + assertFalse(freezeService.isFrozen(recordDeclaredOne)); - // assert that the folder and records no longer frozen - assertFalse(freezeService.isFrozen(rmFolder)); - assertFalse(freezeService.isFrozen(recordOne)); - assertFalse(freezeService.isFrozen(recordDeclaredOne)); + // confirm the hold has been deleted + assertNull(holdService.getHold(filePlan, "hold one")); - // confirm the hold has been deleted - assertNull(holdService.getHold(filePlan, "hold one")); - - return null; - } + return null; + } }); } public void testDeleteHoldBehaviourForMultipleHolds() { + List holds = doTestInTransaction(new Test>() + { + @Override + public List run() throws Exception + { + // create test holds + return createAndCheckHolds(); + } + }); + //Splitting transaction to fix onCreateNodePolicy issue where there was a node not found exception doTestInTransaction(new Test() { @Override public Void run() throws Exception { - // create test holds - List holds = createAndCheckHolds(); NodeRef hold1 = holds.get(0); NodeRef hold2 = holds.get(1); diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM1914Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM1914Test.java index 8650797d79..49cd661457 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM1914Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM1914Test.java @@ -43,6 +43,7 @@ import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; import org.alfresco.util.GUID; import org.apache.commons.lang.StringUtils; +import org.junit.Before; /** * @@ -51,30 +52,26 @@ import org.apache.commons.lang.StringUtils; */ public class RM1914Test extends BaseRMTestCase { - + //Fields required across transactions + NodeRef record1, transferFolder; + public void testRM1914() throws Exception { doBehaviourDrivenTest(new BehaviourDrivenTest() { - - NodeRef record1; - NodeRef record2; - public void given() - { - // 1. Any Category1, Category2 are created + public void given(){ + + // create test holds NodeRef category1 = filePlanService.createRecordCategory(filePlan, GUID.generate()); NodeRef category2 = filePlanService.createRecordCategory(filePlan, GUID.generate()); - - - // 2. Disposition schedule is created for the Category1: - // - applied on Record + Map dsProps = new HashMap(3); dsProps.put(PROP_DISPOSITION_AUTHORITY, CommonRMTestUtils.DEFAULT_DISPOSITION_AUTHORITY); dsProps.put(PROP_DISPOSITION_INSTRUCTIONS, GUID.generate()); dsProps.put(PROP_RECORD_LEVEL_DISPOSITION, true); - DispositionSchedule dispositionSchedule1 = dispositionService.createDispositionSchedule(category1, dsProps); + NodeRef folder1 = recordFolderService.createRecordFolder(category1, GUID.generate()); // - add cutoff after "Related Record Transferred To Inactive Storage" completion event Map dispositionAction1 = new HashMap(3); @@ -82,57 +79,55 @@ public class RM1914Test extends BaseRMTestCase dispositionAction1.put(PROP_DISPOSITION_DESCRIPTION, GUID.generate()); List events = new ArrayList(1); - events.add("related_record_trasfered_inactive_storage"); - dispositionAction1.put(PROP_DISPOSITION_EVENT, (Serializable)events); + events.add("related_record_trasfered_inactive_storage"); + dispositionAction1.put(PROP_DISPOSITION_EVENT, (Serializable) events); dispositionService.addDispositionActionDefinition(dispositionSchedule1, dispositionAction1); - - + // 3. Folder1 > Record1 is created inside Category1 - NodeRef folder1 = recordFolderService.createRecordFolder(category1, GUID.generate()); record1 = recordService.createRecordFromContent(folder1, GUID.generate(), TYPE_CONTENT, null, null); - - - // 4. Disposition schedule is created for the Category2: + + // 4. Disposition schedule is created for the Category2: // applied on Record DispositionSchedule dispositionSchedule2 = dispositionService.createDispositionSchedule(category2, dsProps); - + // - cutoff immediatelly Map dispositionAction2_1 = new HashMap(3); dispositionAction2_1.put(PROP_DISPOSITION_ACTION_NAME, CutOffAction.NAME); dispositionAction2_1.put(PROP_DISPOSITION_DESCRIPTION, GUID.generate()); - dispositionAction2_1.put(PROP_DISPOSITION_PERIOD, CommonRMTestUtils.PERIOD_IMMEDIATELY); + dispositionAction2_1.put(PROP_DISPOSITION_PERIOD, CommonRMTestUtils.PERIOD_IMMEDIATELY); dispositionService.addDispositionActionDefinition(dispositionSchedule2, dispositionAction2_1); - + // - Transfer Immediatelly Map dispositionAction2_2 = new HashMap(4); dispositionAction2_2.put(PROP_DISPOSITION_ACTION_NAME, TransferAction.NAME); dispositionAction2_2.put(PROP_DISPOSITION_DESCRIPTION, GUID.generate()); dispositionAction2_2.put(PROP_DISPOSITION_PERIOD, CommonRMTestUtils.PERIOD_IMMEDIATELY); dispositionAction2_2.put(PROP_DISPOSITION_LOCATION, StringUtils.EMPTY); - + dispositionService.addDispositionActionDefinition(dispositionSchedule2, dispositionAction2_2); - // 5. Folder2 > Record2 is created inside Category2 NodeRef folder2 = recordFolderService.createRecordFolder(category2, GUID.generate()); - record2 = recordService.createRecordFromContent(folder2, GUID.generate(), TYPE_CONTENT, null, null); - + NodeRef record2 = recordService.createRecordFromContent(folder2, GUID.generate(), TYPE_CONTENT, null, null); + // 6. Record1 and Record2 are completed utils.completeRecord(record1); utils.completeRecord(record2); - // 7. Create Cross-Reference link from Record1 to Record2 relationshipService.addRelationship(CUSTOM_REF_CROSSREFERENCE.getLocalName(), record1, record2); + // 8. Cut off and transfer Record2 + rmActionService.executeRecordsManagementAction(record2, CutOffAction.NAME, null); + transferFolder = (NodeRef) rmActionService.executeRecordsManagementAction(record2, TransferAction.NAME) + .getValue(); } public void when() { - // 8. Cut off and transfer Record2 - rmActionService.executeRecordsManagementAction(record2, CutOffAction.NAME, null); - NodeRef transferFolder = (NodeRef) rmActionService.executeRecordsManagementAction(record2, TransferAction.NAME).getValue(); + + rmActionService.executeRecordsManagementAction(transferFolder, TransferCompleteAction.NAME); } diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4804Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4804Test.java index 0005ce388f..3bcf50c6da 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4804Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4804Test.java @@ -46,6 +46,8 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.springframework.extensions.webscripts.GUID; +import javax.xml.soap.Node; + /** * Integration test for RM-4804 * @@ -56,6 +58,10 @@ import org.springframework.extensions.webscripts.GUID; */ public class RM4804Test extends BaseRMTestCase { + //Fields required across transactions + NodeRef record; + NodeRef transferFolder; + /** * Given a category with disposition schedule applied on folder with Cut Of and Transfer, a record folder and a file PDF document * to folder, complete the record @@ -67,14 +73,10 @@ public class RM4804Test extends BaseRMTestCase { doBehaviourDrivenTest(new BehaviourDrivenTest() { - NodeRef recordCategory; - NodeRef recordFolder; - NodeRef record; - public void given() { // category is created - recordCategory = filePlanService.createRecordCategory(filePlan, GUID.generate()); + NodeRef recordCategory = filePlanService.createRecordCategory(filePlan, GUID.generate()); // create a disposition schedule for category, applied on folder Map dsProps = new HashMap(3); @@ -82,7 +84,8 @@ public class RM4804Test extends BaseRMTestCase dsProps.put(PROP_DISPOSITION_INSTRUCTIONS, GUID.generate()); dsProps.put(PROP_RECORD_LEVEL_DISPOSITION, false); - DispositionSchedule dispositionSchedule = dispositionService.createDispositionSchedule(recordCategory, dsProps); + DispositionSchedule dispositionSchedule = dispositionService.createDispositionSchedule(recordCategory, + dsProps); // cutoff immediately Map dispositionActionCutOff = new HashMap(3); @@ -102,8 +105,7 @@ public class RM4804Test extends BaseRMTestCase dispositionService.addDispositionActionDefinition(dispositionSchedule, dispositionActionTransfer); // add folder under category - recordFolder = recordFolderService.createRecordFolder(recordCategory, GUID.generate()); - + NodeRef recordFolder = recordFolderService.createRecordFolder(recordCategory, GUID.generate()); // add record of type PDF under folder Map props = new HashMap(1); props.put(ContentModel.PROP_TITLE, GUID.generate()); @@ -112,14 +114,15 @@ public class RM4804Test extends BaseRMTestCase // complete the record utils.completeRecord(record); + // cut off and transfer record + rmActionService.executeRecordsManagementAction(recordFolder, CutOffAction.NAME, null); + transferFolder = (NodeRef) rmActionService.executeRecordsManagementAction(recordFolder, + TransferAction.NAME) + .getValue(); } public void when() { - // cut off and transfer record - rmActionService.executeRecordsManagementAction(recordFolder, CutOffAction.NAME, null); - NodeRef transferFolder = (NodeRef) rmActionService.executeRecordsManagementAction(recordFolder, TransferAction.NAME) - .getValue(); rmActionService.executeRecordsManagementAction(transferFolder, TransferCompleteAction.NAME); } diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/service/FreezeServiceImplTest.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/service/FreezeServiceImplTest.java index 514d52fe97..65d5f51fad 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/service/FreezeServiceImplTest.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/service/FreezeServiceImplTest.java @@ -43,7 +43,9 @@ import org.alfresco.service.cmr.repository.NodeRef; */ public class FreezeServiceImplTest extends BaseRMTestCase { - @Override + private List holdAssocs; + + @Override protected boolean isRecordTest() { return true; @@ -56,7 +58,9 @@ public class FreezeServiceImplTest extends BaseRMTestCase */ public void testFreezeService() throws Exception { - doTestInTransaction(new Test() + + + doTestInTransaction(new Test() { @Override public Void run() throws Exception @@ -71,20 +75,26 @@ public class FreezeServiceImplTest extends BaseRMTestCase assertTrue(filePlanService.isFilePlanComponent(recordFour)); // Freeze a record - NodeRef hold101 = holdService.createHold(filePlan, "freezename 101", "FreezeReason", null); - assertNotNull(hold101); - holdService.addToHold(hold101, recordOne); - //assertTrue(freezeService.hasFrozenChildren(rmFolder)); + NodeRef hold101 = holdService.createHold(filePlan, "freezename 101", "FreezeReason", null); + + assertNotNull(hold101); + holdService.addToHold(hold101, recordOne); + + //assertTrue(freezeService.hasFrozenChildren(rmFolder)); + + // Check the hold exists + holdAssocs = holdService.getHolds(filePlan); + assertNotNull(holdAssocs); + assertEquals(1, holdAssocs.size()); + + NodeRef holdNodeRef = holdAssocs.iterator().next(); + - // Check the hold exists - List holdAssocs = holdService.getHolds(filePlan); - assertNotNull(holdAssocs); - assertEquals(1, holdAssocs.size()); - NodeRef holdNodeRef = holdAssocs.iterator().next(); assertEquals(holdNodeRef, hold101); assertTrue(holdService.isHold(holdNodeRef)); assertEquals("FreezeReason", holdService.getHoldReason(holdNodeRef)); - List frozenNodes = holdService.getHeld(holdNodeRef); + List frozenNodes = holdService.getHeld(holdNodeRef); + assertNotNull(frozenNodes); assertEquals(1, frozenNodes.size()); @@ -102,11 +112,12 @@ public class FreezeServiceImplTest extends BaseRMTestCase assertEquals("NewFreezeReason", holdService.getHoldReason(holdNodeRef)); // Freeze a number of records - List records = new ArrayList(); + List records = new ArrayList(); records.add(recordOne); records.add(recordTwo); records.add(recordThree); NodeRef newHold = holdService.createHold(filePlan, "Hold 102", "Freeze a set of nodes", null); + holdService.addToHold(newHold, records); assertNotNull(newHold); assertTrue(holdService.isHold(newHold)); @@ -115,6 +126,7 @@ public class FreezeServiceImplTest extends BaseRMTestCase holdAssocs = holdService.getHolds(filePlan); assertNotNull(holdAssocs); assertEquals(2, holdAssocs.size()); + for (NodeRef hold : holdAssocs) { String reason = holdService.getHoldReason(hold); @@ -148,7 +160,6 @@ public class FreezeServiceImplTest extends BaseRMTestCase // Unfreeze a node holdService.removeFromAllHolds(recordThree); - // Check the holds holdAssocs = holdService.getHolds(filePlan); assertNotNull(holdAssocs); @@ -183,9 +194,17 @@ public class FreezeServiceImplTest extends BaseRMTestCase assertNotNull(freezeService.getFreezeInitiator(recordTwo)); assertFalse(freezeService.isFrozen(recordThree)); assertFalse(freezeService.isFrozen(recordFour)); - + return null; + } + }); + //Splitting transaction to fix onCreateNodePolicy issue where there was a node not found exception + doTestInTransaction(new Test() + { + @Override + public Void run() throws Exception + { // Relinquish the first hold - holdNodeRef = holdAssocs.iterator().next(); + NodeRef holdNodeRef = holdAssocs.iterator().next(); holdService.deleteHold(holdNodeRef); // Check the existing hold @@ -203,6 +222,7 @@ public class FreezeServiceImplTest extends BaseRMTestCase // delete hold holdService.deleteHold(holdNodeRef); + holdAssocs = holdService.getHolds(filePlan); assertEquals(0, holdAssocs.size()); @@ -222,12 +242,19 @@ public class FreezeServiceImplTest extends BaseRMTestCase nodes.add(recordThree); holdService.addToHold(hold, nodes); //assertTrue(freezeService.hasFrozenChildren(rmFolder)); - // Check the hold holdAssocs = holdService.getHolds(filePlan); assertNotNull(holdAssocs); assertEquals(1, holdAssocs.size()); - + return null; + } + }); + //Splitting transaction to fix onCreateNodePolicy issue where there was a node not found exception + doTestInTransaction(new Test() + { + @Override + public Void run() throws Exception + { // Relinquish the first hold holdService.deleteHold(holdAssocs.iterator().next()); From 11f248a70b7bfbdac22621b9483fb614950ec1c0 Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Thu, 7 Sep 2017 11:17:13 +0100 Subject: [PATCH 5/9] [maven-release-plugin] prepare release V2.6.b --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 2d3984ba21..50d0b0b429 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-rm pom - 2.6-SNAPSHOT + 2.6.b 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.6.b diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index d98b337c2a..b92e627fad 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.6-SNAPSHOT + 2.6.b diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index 151b0bcce1..0a96f02973 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm-automation - 2.6-SNAPSHOT + 2.6.b diff --git a/rm-community/pom.xml b/rm-community/pom.xml index 8e9816ba62..2f3dde53f6 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.6-SNAPSHOT + 2.6.b diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 4a59bbbdb7..89e2263287 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.6-SNAPSHOT + 2.6.b diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index e771a9ff00..1966cec5d0 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-rm-community - 2.6-SNAPSHOT + 2.6.b From 573d82be914f0125ef4e6de3389fb8297a976eac Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Thu, 7 Sep 2017 11:17:16 +0100 Subject: [PATCH 6/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 50d0b0b429..2d3984ba21 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-rm pom - 2.6.b + 2.6-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.6.b + HEAD diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index b92e627fad..d98b337c2a 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.6.b + 2.6-SNAPSHOT diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index 0a96f02973..151b0bcce1 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm-automation - 2.6.b + 2.6-SNAPSHOT diff --git a/rm-community/pom.xml b/rm-community/pom.xml index 2f3dde53f6..8e9816ba62 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-rm - 2.6.b + 2.6-SNAPSHOT diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 89e2263287..4a59bbbdb7 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.6.b + 2.6-SNAPSHOT diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index 1966cec5d0..e771a9ff00 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-rm-community - 2.6.b + 2.6-SNAPSHOT From a539850510d59fbba8618e8ed0621dc5926474d1 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Thu, 7 Sep 2017 15:06:32 +0300 Subject: [PATCH 7/9] exclude the initialization of web driver from the tas utility (issue introduce after upgrade the rest api tas dependency) --- .../java/org/alfresco/rest/rm/community/site/RMSiteTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java index cc0f560dd5..6b9653f284 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java @@ -47,7 +47,6 @@ import static org.springframework.http.HttpStatus.OK; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; -import org.alfresco.dataprep.SiteService.Visibility; import org.alfresco.rest.rm.community.base.BaseRMRestTest; import org.alfresco.rest.rm.community.base.TestData; import org.alfresco.rest.rm.community.model.site.RMSite; @@ -55,6 +54,7 @@ import org.alfresco.rest.rm.community.requests.gscore.api.RMSiteAPI; import org.alfresco.utility.data.RandomData; import org.alfresco.utility.model.UserModel; import org.alfresco.utility.report.Bug; +import org.springframework.social.alfresco.api.entities.Site.Visibility; import org.testng.annotations.Test; /** From d8f16a990ccd229cccd042d0b2c5eb0903ac413e Mon Sep 17 00:00:00 2001 From: Tom Page Date: Fri, 8 Sep 2017 14:10:47 +0100 Subject: [PATCH 8/9] RM-5611 Code review fixes. Remove nested try catch. Add additional check that we don't have duplicate topics selected. --- .../java/org/alfresco/rest/core/v0/BaseAPI.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java index 74ea1bc661..0373fbcc73 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java @@ -404,15 +404,11 @@ public abstract class BaseAPI try { - String bodyString = EntityUtils.toString(response.getEntity()); - try - { - responseBody = new JSONObject(bodyString); - } - catch (JSONException error) - { - LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error); - } + responseBody = new JSONObject(EntityUtils.toString(response.getEntity())); + } + catch (JSONException error) + { + LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error); } catch (ParseException | IOException error) { From 68c6b497d6c46fb1d14a66ffeb14f8b07444b56a Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Mon, 11 Sep 2017 08:58:07 +0300 Subject: [PATCH 9/9] data prep dependency update and modification to address the issues encounter add a helper method to retrieve the rm node id based on the relative path using the core api --- .../src/main/java/org/alfresco/rest/core/v0/BaseAPI.java | 2 +- .../java/org/alfresco/rest/rm/community/site/RMSiteTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java index 1e88d4be45..dd0341b446 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java @@ -87,7 +87,7 @@ public abstract class BaseAPI private ContentService contentService; private static final String NODE_REF_WORKSPACE_SPACES_STORE = "workspace://SpacesStore/"; - private static final String FILE_PLAN_PATH = "Sites/rm/documentLibrary"; + private static final String FILE_PLAN_PATH = "/Sites/rm/documentLibrary"; /** * Helper method to extract list of properties values from result. diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java index 6b9653f284..cc0f560dd5 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/site/RMSiteTests.java @@ -47,6 +47,7 @@ import static org.springframework.http.HttpStatus.OK; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; +import org.alfresco.dataprep.SiteService.Visibility; import org.alfresco.rest.rm.community.base.BaseRMRestTest; import org.alfresco.rest.rm.community.base.TestData; import org.alfresco.rest.rm.community.model.site.RMSite; @@ -54,7 +55,6 @@ import org.alfresco.rest.rm.community.requests.gscore.api.RMSiteAPI; import org.alfresco.utility.data.RandomData; import org.alfresco.utility.model.UserModel; import org.alfresco.utility.report.Bug; -import org.springframework.social.alfresco.api.entities.Site.Visibility; import org.testng.annotations.Test; /**