Reverse merged 5.1.N (5.1.1) to get a green build

123552: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
            123511 mward: MNT-15815: fix failing test due to prefix clash,
         123550: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
            123490 mward: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
               123221 mward: ACE-5120: further fixes (ADMLuceneTest),
         123549: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
            123489 mward: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
               123148 mward: ACE-5120: change NS prefix in test to avoid clash,
         123548: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
            123488 mward: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
               123145 mward: ACE-5120: fix ADMLuceneCategoryTest,
         123547: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
            123487 mward: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
               123142 mward: ACE-5120: further test fixes,
         123546: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
            123486 mward: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
               123028 mward: ACE-5120: test fixes,
         123545: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
            123483 mward: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
               123000 mward: ACE-5120: Dictionary should not allow duplication of namespace prefixes,
         123543: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
            123477 amorarasu: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
               123368 gjames: MNT-15114: Test to ensure the policy fires


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@123739 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-03-12 10:16:48 +00:00
parent 666a4bd587
commit ac86882aee
8 changed files with 141 additions and 186 deletions

View File

@@ -75,6 +75,7 @@ import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.BaseSpringTest;
import org.alfresco.util.GUID;
import org.alfresco.util.Pair;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.Dialect;
import org.springframework.context.ApplicationContext;
@@ -1450,7 +1451,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
pathARef.getChildRef(),
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("pathC"));
// remove the path B association
boolean removedB = nodeService.removeChildAssociation(pathBRef);
assertTrue("Association was not removed", removedB);
@@ -1460,13 +1461,13 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
// remove the path C association
boolean removedC = nodeService.removeChildAssociation(pathCRef);
assertTrue("Association was not removed", removedC);
removedC = nodeService.removeSecondaryChildAssociation(pathCRef);
removedC = nodeService.removeSeconaryChildAssociation(pathCRef);
assertFalse("Non-existent association was apparently removed", removedC);
// Now verify that primary associations are caught
try
{
nodeService.removeSecondaryChildAssociation(pathPrimaryRef);
nodeService.removeSeconaryChildAssociation(pathPrimaryRef);
fail("Primary association not detected");
}
catch (IllegalArgumentException e)
@@ -1474,45 +1475,6 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
// Expected
}
}
public void testRemoveChildPolicyFires() throws Exception
{
ChildAssociationRef pathPrimaryRef = nodeService.createNode(
rootNodeRef,
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("parent_child"),
ContentModel.TYPE_CONTAINER);
NodeRef parentRef = pathPrimaryRef.getParentRef();
ChildAssociationRef pathARef = nodeService.createNode(
parentRef,
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("patha"),
ContentModel.TYPE_CONTAINER);
ChildAssociationRef pathBRef = nodeService.addChild(
parentRef,
pathARef.getChildRef(),
ContentModel.ASSOC_ARCHIVED_LINK,
QName.createQName("pathb"));
ChildAssociationRef pathCRef = nodeService.addChild(
parentRef,
pathARef.getChildRef(),
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("pathc"));
BeforeDeletePolicyTester beforeDeletePolicy = new BeforeDeletePolicyTester();
this.policyComponent.bindAssociationBehaviour(
NodeServicePolicies.BeforeDeleteChildAssociationPolicy.QNAME,
beforeDeletePolicy,
new JavaBehaviour(beforeDeletePolicy, "beforeDeleteChildAssociation"));
boolean removed = nodeService.removeSecondaryChildAssociation(pathBRef);
assertTrue("Association was removed", removed);
assertEquals("The BeforeDeleteChildAssociationPolicy must fire on removeSecondaryChildAssociation",pathBRef, beforeDeletePolicy.childRef);
removed = nodeService.removeChildAssociation(pathCRef);
assertTrue("Association was removed", removed);
assertEquals("The BeforeDeleteChildAssociationPolicy must fire on removeChildAssociation", pathCRef, beforeDeletePolicy.childRef);
}
public void testRemoveChildByRef() throws Exception
{
@@ -2610,17 +2572,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
}
};
public static class BeforeDeletePolicyTester implements NodeServicePolicies.BeforeDeleteChildAssociationPolicy
{
ChildAssociationRef childRef;
@Override
public void beforeDeleteChildAssociation(ChildAssociationRef childAssocRef)
{
this.childRef = childAssocRef;
}
}
public void testMoveNode() throws Exception
{
Map<QName, ChildAssociationRef> assocRefs = buildNodeGraph();