mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.0 to HEAD
5450: (from V1.4) 5423 (V1.4): CIFS authentication 5451: (from V1.4) 5432 (V1.4): 'No root node' fix 5437 (V1.4): EHCache upgrade 5440 (V1.4): AR-1355 - Ticket cache config fix 5442 (V1.4): Bootstrap reorganization 5446 (V1.4): AR-1353 5452: (from V1.4) 5391: AR-1310 (script rename fix) 5453: Win32NetBIOS LANA 5454: CIFS unused code git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5483 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -35,6 +35,8 @@ import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.domain.ChildAssoc;
|
||||
import org.alfresco.repo.domain.Node;
|
||||
import org.alfresco.repo.domain.NodeStatus;
|
||||
import org.alfresco.repo.node.BaseNodeServiceTest;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
@@ -353,4 +355,29 @@ public class DbNodeServiceImplTest extends BaseNodeServiceTest
|
||||
mlTextProperty,
|
||||
propertiesDirect.get(BaseNodeServiceTest.PROP_QNAME_ML_TEXT_VALUE));
|
||||
}
|
||||
|
||||
public void testDuplicatePrimaryParentHandling() throws Exception
|
||||
{
|
||||
Map<QName, ChildAssociationRef> assocRefs = buildNodeGraph();
|
||||
// get the node to play with
|
||||
ChildAssociationRef n1pn3Ref = assocRefs.get(QName.createQName(BaseNodeServiceTest.NAMESPACE, "n1_p_n3"));
|
||||
ChildAssociationRef n6pn8Ref = assocRefs.get(QName.createQName(BaseNodeServiceTest.NAMESPACE, "n6_p_n8"));
|
||||
final NodeRef n1Ref = n1pn3Ref.getParentRef();
|
||||
final NodeRef n8Ref = n6pn8Ref.getChildRef();
|
||||
|
||||
// Add a make n1 a second primary parent of n8
|
||||
Node n1 = nodeDaoService.getNode(n1Ref);
|
||||
Node n8 = nodeDaoService.getNode(n8Ref);
|
||||
ChildAssoc assoc = nodeDaoService.newChildAssoc(
|
||||
n1,
|
||||
n8,
|
||||
true,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NAMESPACE, "n1pn8"));
|
||||
|
||||
// Now get the node primary parent
|
||||
nodeService.getPrimaryParent(n8Ref);
|
||||
// Get it again
|
||||
nodeService.getPrimaryParent(n8Ref);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user