mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged v3.0 to HEAD
12725: *RECORD ONLY* remove errant comma 12740: Merged V2.2 to V3.0 12577: Fix ETWOTWO-973 - Enable Logging of Leaked Transactions By Default. 12582: *RECORD-ONLY* Fix ETWOTWO-872 - openoffice bootstrap config in WAR bundle. 12628: *RECORD-ONLY* Fix for ETWOTWO-937: Regression Multi-Valued properties - nullpointerexception if only one value is set initially 12741: Merged V2.2 to V3.0 12643: Fixed ETWOTWO-354: null properties created on copy-pasted nodes 12694: Added NodeService.addProperties() method 12695: Follow-up fix for ETWOTWO-354: null properties created on copy-pasted nodes 12715: Fix ETWOTWO-988: Gather Oracle schema stats before, during and after upgrade 12730: IndexInfo.main processes multiple directory arguments 12737: Fixed ETWOTWO-246, ETHREEOH-996 (by merge) and ALFCOM-2299: Cancel discussion orphans nodes 12745: Merged V2.2 to V3.0 12744: Fixed ETWOTWO-1011 and (by merge) ALFCOM-2372: Upgrade from 2.1C fails svn diff -N . Merged /alfresco/BRANCHES/V3.0:r12725,12740-12741,12745 Merged /alfresco/BRANCHES/V2.2:r12577,12582,12628,12643,12694-12695,12715,12730,12737,12744 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12748 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -110,6 +110,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
public static final QName ASPECT_QNAME_MANDATORY = QName.createQName(NAMESPACE, "mandatoryaspect");
|
||||
public static final QName ASPECT_QNAME_WITH_DEFAULT_VALUE = QName.createQName(NAMESPACE, "withDefaultValue");
|
||||
public static final QName PROP_QNAME_TEST_TITLE = QName.createQName(NAMESPACE, "title");
|
||||
public static final QName PROP_QNAME_TEST_DESCRIPTION = QName.createQName(NAMESPACE, "description");
|
||||
public static final QName PROP_QNAME_TEST_CONTENT = QName.createQName(NAMESPACE, "content");
|
||||
public static final QName PROP_QNAME_BOOLEAN_VALUE = QName.createQName(NAMESPACE, "booleanValue");
|
||||
public static final QName PROP_QNAME_INTEGER_VALUE = QName.createQName(NAMESPACE, "integerValue");
|
||||
@@ -709,6 +710,36 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
0, nodeService.getTargetAssocs(sourceNodeRef, RegexQNamePattern.MATCH_ALL).size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test {@link https://issues.alfresco.com/jira/browse/ALFCOM-2299 ALFCOM-2299}
|
||||
*/
|
||||
public void testAspectRemovalCascadeDelete() throws Exception
|
||||
{
|
||||
// Create a node to add the aspect to
|
||||
NodeRef sourceNodeRef = nodeService.createNode(
|
||||
rootNodeRef,
|
||||
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
||||
QName.createQName(BaseNodeServiceTest.NAMESPACE, "testAspectRemovalCascadeDelete"),
|
||||
ContentModel.TYPE_CONTAINER).getChildRef();
|
||||
|
||||
// Add the aspect to the source node and add a child using an association defined on the aspect
|
||||
nodeService.addAspect(sourceNodeRef, ASPECT_WITH_ASSOCIATIONS, null);
|
||||
NodeRef targetNodeRef = nodeService.createNode(
|
||||
sourceNodeRef,
|
||||
ASSOC_ASPECT_CHILD_ASSOC,
|
||||
QName.createQName(BaseNodeServiceTest.NAMESPACE, "testAspectRemovalCascadeDelete"),
|
||||
ContentModel.TYPE_CONTAINER).getChildRef();
|
||||
|
||||
assertTrue("Child node must exist", nodeService.exists(targetNodeRef));
|
||||
// Now remove the aspect from the source node and check that the target node was cascade-deleted
|
||||
nodeService.removeAspect(sourceNodeRef, ASPECT_WITH_ASSOCIATIONS);
|
||||
assertFalse("Child node must have been cascade-deleted", nodeService.exists(targetNodeRef));
|
||||
|
||||
// Commit for good measure
|
||||
setComplete();
|
||||
endTransaction();
|
||||
}
|
||||
|
||||
private static final QName ASPECT_QNAME_TEST_RENDERED = QName.createQName(NAMESPACE, "rendered");
|
||||
private static final QName ASSOC_TYPE_QNAME_TEST_RENDITION = QName.createQName(NAMESPACE, "rendition-page");
|
||||
private static final QName TYPE_QNAME_TEST_RENDITION_PAGE = QName.createQName(NAMESPACE, "rendition-page");
|
||||
@@ -1205,6 +1236,26 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
}
|
||||
}
|
||||
|
||||
public void setAddProperties() throws Exception
|
||||
{
|
||||
Map<QName, Serializable> properties = nodeService.getProperties(rootNodeRef);
|
||||
// Add an aspect with a default value
|
||||
nodeService.addAspect(rootNodeRef, ASPECT_QNAME_TEST_TITLED, null);
|
||||
assertNull("Expected null property", nodeService.getProperty(rootNodeRef, PROP_QNAME_TEST_TITLE));
|
||||
assertNull("Expected null property", nodeService.getProperty(rootNodeRef, PROP_QNAME_TEST_DESCRIPTION));
|
||||
|
||||
// Now add a map of two properties and check
|
||||
Map<QName, Serializable> addProperties = new HashMap<QName, Serializable>(11);
|
||||
addProperties.put(PROP_QNAME_TEST_TITLE, "Title");
|
||||
addProperties.put(PROP_QNAME_TEST_DESCRIPTION, "Description");
|
||||
nodeService.addProperties(rootNodeRef, addProperties);
|
||||
|
||||
// Check
|
||||
Map<QName, Serializable> checkProperties = nodeService.getProperties(rootNodeRef);
|
||||
assertEquals("Title", checkProperties.get(PROP_QNAME_TEST_TITLE));
|
||||
assertEquals("Description", checkProperties.get(PROP_QNAME_TEST_DESCRIPTION));
|
||||
}
|
||||
|
||||
public void testRemoveProperty() throws Exception
|
||||
{
|
||||
Map<QName, Serializable> properties = nodeService.getProperties(rootNodeRef);
|
||||
|
Reference in New Issue
Block a user