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

107149: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud)
      107038: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.3)
         107000: Merged DEV to V4.2-BUG-FIX (4.2.5).
            106581: MNT-14143: Reverting to previous version is removing the aspects added to document in between.
                       - in VersionServiceImplTest was added test_MNT14143 test. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@107166 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-06-25 22:46:06 +00:00
parent 2bbcb1f174
commit 0efec9d6ec

View File

@@ -2695,4 +2695,33 @@ public class VersionServiceImplTest extends BaseVersionStoreTest
}
}
}
public void test_MNT14143()
{
// Create a non-versionable node
final NodeRef node = createNewNode();
Map<QName, Serializable> verProperties = new HashMap<QName, Serializable>(1);
verProperties.put(ContentModel.PROP_AUTO_VERSION_PROPS, false);
this.versionService.ensureVersioningEnabled(node, verProperties);
// add 'dublincore' aspect
nodeService.addAspect(node, ContentModel.ASPECT_DUBLINCORE, null);
nodeService.setProperty(node, ContentModel.PROP_SUBJECT, "Test subject");
Version version10 = this.versionService.getCurrentVersion(node);
assertEquals("1.0", version10.getVersionLabel());
createVersion(node);
Version version11 = this.versionService.getCurrentVersion(node);
assertEquals("1.1", version11.getVersionLabel());
this.versionService.revert(node, version10);
assertFalse(nodeService.hasAspect(node, ContentModel.ASPECT_DUBLINCORE));
this.versionService.revert(node, version11);
assertTrue(nodeService.hasAspect(node, ContentModel.ASPECT_DUBLINCORE));
}
}