mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
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:
@@ -201,7 +201,7 @@ public class VersionableAspectTest extends TestCase
|
||||
}
|
||||
});
|
||||
|
||||
assertDocumentVersionAndName("1.0", name02);
|
||||
assertDocumentVersionAndName("1.0", name02, VersionType.MAJOR);
|
||||
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
@@ -214,7 +214,7 @@ public class VersionableAspectTest extends TestCase
|
||||
}
|
||||
});
|
||||
|
||||
assertDocumentVersionAndName("1.1", name11);
|
||||
assertDocumentVersionAndName("1.1", name11, VersionType.MINOR);
|
||||
}
|
||||
|
||||
public void testAutoVersionIncrementOnPropertiesUpdateByLockOwnerAlf14584() throws Exception
|
||||
@@ -258,6 +258,11 @@ public class VersionableAspectTest extends TestCase
|
||||
}
|
||||
|
||||
private void assertDocumentVersionAndName(final String versionLabel, final String name)
|
||||
{
|
||||
assertDocumentVersionAndName(versionLabel, name, null);
|
||||
}
|
||||
|
||||
private void assertDocumentVersionAndName(final String versionLabel, final String name, final VersionType versionType)
|
||||
{
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
@@ -267,6 +272,13 @@ public class VersionableAspectTest extends TestCase
|
||||
Map<QName, Serializable> properties = getAndAssertProperties(document, versionLabel);
|
||||
assertEquals(name, properties.get(ContentModel.PROP_NAME));
|
||||
|
||||
if (versionType != null)
|
||||
{
|
||||
Serializable versionTypeProperty = nodeService.getProperty(document, ContentModel.PROP_VERSION_TYPE);
|
||||
assertNotNull(versionTypeProperty);
|
||||
assertTrue(versionTypeProperty.toString().equals(versionType.toString()));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}, true);
|
||||
|
Reference in New Issue
Block a user