mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
93245: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud) 93127: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1) 93074: Add negative test when attempting to add a 'residual' aspect (aspect not in the dictionary) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94943 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -54,6 +54,7 @@ import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryException;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.InvalidAspectException;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.repository.AssociationExistsException;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
@@ -140,6 +141,10 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
public static final QName ASSOC_TYPE_QNAME_TEST_CONTAINS = ContentModel.ASSOC_CONTAINS;
|
||||
public static final QName ASSOC_TYPE_QNAME_TEST_NEXT = QName.createQName(NAMESPACE, "next");
|
||||
|
||||
public static final QName ASPECT_RESIDUAL = QName.createQName(NAMESPACE, "residual");
|
||||
public static final QName PROP_QNAME_RESIDUAL_STRING = QName.createQName(NAMESPACE, "residualString");
|
||||
public static final QName PROP_QNAME_RESIDUAL_LONG = QName.createQName(NAMESPACE, "residualLong");
|
||||
|
||||
public static final QName ASPECT_WITH_ASSOCIATIONS = QName.createQName(NAMESPACE, "withAssociations");
|
||||
public static final QName ASSOC_ASPECT_CHILD_ASSOC = QName.createQName(NAMESPACE, "aspect-child-assoc");
|
||||
public static final QName ASSOC_ASPECT_NORMAL_ASSOC = QName.createQName(NAMESPACE, "aspect-normal-assoc");
|
||||
@@ -2390,6 +2395,30 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
assertEquals("Cannot set Node DB ID", nodeDbId, nodeDbIdCheck);
|
||||
}
|
||||
|
||||
public void testResidual() throws Exception
|
||||
{
|
||||
// Add the residual aspect
|
||||
Map<QName, Serializable> props = new HashMap<QName, Serializable>(5);
|
||||
props.put(PROP_QNAME_RESIDUAL_STRING, "ABC");
|
||||
props.put(PROP_QNAME_RESIDUAL_LONG, Long.valueOf(123));
|
||||
try
|
||||
{
|
||||
nodeService.addAspect(rootNodeRef, ASPECT_RESIDUAL, props);
|
||||
}
|
||||
catch (InvalidAspectException e)
|
||||
{
|
||||
// Expected
|
||||
}
|
||||
//
|
||||
// // Get the values back
|
||||
// Map<QName, Serializable> propsCheck = nodeService.getProperties(rootNodeRef);
|
||||
// assertEquals("Residual properties not present and equal. ", props, propsCheck);
|
||||
// assertTrue("Expect residual aspect to be present.", nodeService.hasAspect(rootNodeRef, ASPECT_RESIDUAL));
|
||||
//
|
||||
// setComplete();
|
||||
// endTransaction();
|
||||
}
|
||||
|
||||
public void testGetParentAssocs() throws Exception
|
||||
{
|
||||
Map<QName, ChildAssociationRef> assocRefs = buildNodeGraph();
|
||||
|
Reference in New Issue
Block a user