Merged 5.0.N (5.0.4) to 5.1.N (5.1.2)

127236 dungureanu: MNT-15149 : Rule set with "Rule applied to subfolder" also applies to a comment node.
      - added fm:post into ignored types list
      - externalised list into the spring config 
      - created test for ignored types


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@127263 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrei Rebegea
2016-05-19 15:05:40 +00:00
parent 4dcd2ce286
commit a710e77559
3 changed files with 51 additions and 17 deletions

View File

@@ -26,6 +26,7 @@
package org.alfresco.repo.rule.ruletrigger;
import org.alfresco.model.ContentModel;
import org.alfresco.model.ForumModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.ServiceRegistry;
@@ -97,7 +98,23 @@ public class RuleTriggerTest extends BaseSpringTest
// Check to see if the rule type has been triggered
assertTrue(ruleType.rulesTriggered);
}
public void testOnCreateIgnoredTypesTrigger()
{
TestRuleType ruleType = createTestRuleType(ON_CREATE_NODE_TRIGGER);
assertFalse(ruleType.rulesTriggered);
//Try and trigger the type
this.nodeService.createNode(
this.rootNodeRef,
ForumModel.ASSOC_DISCUSSION,
ForumModel.ASSOC_DISCUSSION,
ForumModel.TYPE_POST);
//Check to see if the rule type has been triggered
assertFalse(ruleType.rulesTriggered);
}
public void testOnUpdateNodeTrigger()
{
NodeRef nodeRef = this.nodeService.createNode(