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

120821 aleahu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
      120757 adragoi: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.4)
         120693 abalmus: MNT-14681 : No VersionType is set when content is updated and autoversion is active
            - Provided fix and tests.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123631 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-03-11 21:40:13 +00:00
parent ed401006aa
commit fa1613fa7e
3 changed files with 43 additions and 2 deletions

View File

@@ -2258,6 +2258,29 @@ public class VersionServiceImplTest extends BaseVersionStoreTest
assertEquals(editionCodeArchive.getClass(), Integer.class);
}
/**
* Check that the version type property is actually set when creating a new version.
*
* @see https://issues.alfresco.com/jira/browse/MNT-14681
*/
public void testVersionTypeIsSet()
{
ChildAssociationRef childAssociation = nodeService.createNode(this.rootNodeRef, ContentModel.ASSOC_CHILDREN,
QName.createQName("http://www.alfresco.org/test/versiontypeissettest/1.0", "versionTypeIsSetTest"), TEST_TYPE_QNAME);
NodeRef newNode = childAssociation.getChildRef();
assertNull(nodeService.getProperty(newNode, ContentModel.PROP_VERSION_TYPE));
Map<String, Serializable> versionProps = new HashMap<String, Serializable>(1);
versionProps.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
versionService.createVersion(newNode, versionProps);
Serializable versionTypeProperty = nodeService.getProperty(newNode, ContentModel.PROP_VERSION_TYPE);
assertNotNull(versionTypeProperty);
assertTrue(versionTypeProperty.toString().equals(VersionType.MINOR.toString()));
}
/**
* Check read permission for the frozen node
*/