Fix SAIL-389 (SAIL-294): NodeDAO: single-valued, d:any properties don't handle increasing array values

- Incorrect translation of raw values back to Serializable for cache purposes
 - Addition of Savepoint around alf_node insert


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21136 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-07-13 15:22:53 +00:00
parent 297309f1aa
commit e7dff0383a
4 changed files with 74 additions and 16 deletions

View File

@@ -1892,6 +1892,40 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
assertEquals("MLText collection didn't come back correctly.", mlTextCollection, mlTextCollectionCheck);
}
/**
* Ensures that d:any types are handled correctly when adding values
*/
public void testMultivaluedSerializable() throws Exception
{
ArrayList<String> listProp = new ArrayList<String>();
listProp.clear();
nodeService.addProperties(
rootNodeRef,
Collections.singletonMap(PROP_QNAME_ANY_PROP_MULTIPLE, (Serializable) listProp));
listProp.add("ONE");
nodeService.addProperties(
rootNodeRef,
Collections.singletonMap(PROP_QNAME_ANY_PROP_MULTIPLE, (Serializable) listProp));
listProp.add("TWO");
nodeService.addProperties(
rootNodeRef,
Collections.singletonMap(PROP_QNAME_ANY_PROP_MULTIPLE, (Serializable) listProp));
listProp.clear();
nodeService.addProperties(
rootNodeRef,
Collections.singletonMap(PROP_QNAME_ANY_PROP_SINGLE, (Serializable) listProp));
listProp.add("ONE");
nodeService.addProperties(
rootNodeRef,
Collections.singletonMap(PROP_QNAME_ANY_PROP_SINGLE, (Serializable) listProp));
listProp.add("TWO");
nodeService.addProperties(
rootNodeRef,
Collections.singletonMap(PROP_QNAME_ANY_PROP_SINGLE, (Serializable) listProp));
}
/**
* Checks that the {@link ContentModel#ASPECT_REFERENCEABLE referencable} properties
* are present