Merged 5.1.N (5.1.1) to HEAD (5.2)

122735 adragoi: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
      122668 aleahu: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
         122625 aleahu: Merged V4.2.6 (4.2.6) to V4.2-BUG-FIX (4.2.7)
            122548 rmunteanu: Merged DEV to V4.2.6 (4.2.6)
               122546: MNT-14204: Enterprise bulkimport tool is not versioning for inplace import from two different batches
                  - If only version files are imported, version history is no longer removed and the version number is incremented
                  - Added new in-place import test and updated one streaming import test


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123684 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-03-11 22:32:08 +00:00
parent b6bec0669e
commit c6eef005f3
3 changed files with 40 additions and 18 deletions

View File

@@ -462,9 +462,9 @@ public class BulkImportTest extends AbstractBulkImportTests
assertNotNull(history);
assertEquals("Imported file should have 5 versions:", 5, history.getAllVersions().size());
assertEquals("Imported file should have 9 versions:", 9, history.getAllVersions().size());
Version[] versions = history.getAllVersions().toArray(new Version[5]);
Version[] versions = history.getAllVersions().toArray(new Version[9]);
//compare the content of each version
ContentReader contentReader;
@@ -488,6 +488,23 @@ public class BulkImportTest extends AbstractBulkImportTests
assertNotNull(contentReader);
assertEquals("This is version 1 of replaced on import fileWithVersions.txt.", contentReader.getContentString());
// versions from bulkimport3/initial
contentReader = this.contentService.getReader(versions[5].getFrozenStateNodeRef(), ContentModel.PROP_CONTENT);
assertNotNull(contentReader);
assertEquals("This is the final version of fileWithVersions.txt.", contentReader.getContentString());
contentReader = this.contentService.getReader(versions[6].getFrozenStateNodeRef(), ContentModel.PROP_CONTENT);
assertNotNull(contentReader);
assertEquals("This is version 3 of fileWithVersions.txt.", contentReader.getContentString());
contentReader = this.contentService.getReader(versions[7].getFrozenStateNodeRef(), ContentModel.PROP_CONTENT);
assertNotNull(contentReader);
assertEquals("This is version 2 of fileWithVersions.txt.", contentReader.getContentString());
contentReader = this.contentService.getReader(versions[8].getFrozenStateNodeRef(), ContentModel.PROP_CONTENT);
assertNotNull(contentReader);
assertEquals("This is version 1 of fileWithVersions.txt.", contentReader.getContentString());
txn.commit();
txn = transactionService.getUserTransaction();
txn.begin();