Package org.emftrace.metamodel.RuleModel

Examples of org.emftrace.metamodel.RuleModel.Rule


    }

    @Test
    public void testRunProjectTraceRuleListOfListOfEObject()
    {
        Rule rule = RuleModelFactory.eINSTANCE.createRule();
        accessLayer.addElement(project, rule);
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        e1.setType("TraceLink");
        e1.setAlias("e1");
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e2);
        e2.setType("Concern");
        e2.setAlias("e2");
        rule.getElements().add(e1);
        rule.getElements().add(e2);
        TraceLink link = LinkModelFactory.eINSTANCE.createTraceLink();
        accessLayer.addElement(project, link);
        Concern concern = URNModelFactory.eINSTANCE.createConcern();
        accessLayer.addElement(project, concern);
       
View Full Code Here


    }
   
    @Test
    public void testJoinAND()
    {
      Rule rule = RuleModelFactory.eINSTANCE.createRule();

      /*
       * create the following rule:
       *
       * <AND>
       *  bc1
       *  bc2
       *  bc3
       * </AND>
       */
      LogicCondition lc = RuleModelFactory.eINSTANCE.createLogicCondition();
      BaseCondition bc1 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc2 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc3 = RuleModelFactory.eINSTANCE.createBaseCondition();
     
      rule.setConditions(lc);
      lc.getBaseConditions().add(bc1);
      lc.getBaseConditions().add(bc2);
      lc.getBaseConditions().add(bc3);
     
      List<BaseCondition> conditions = new ArrayList<BaseCondition>();
      conditions.add(bc1);
      conditions.add(bc2);
      conditions.add(bc3);
     
      ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
     
      rule.getElements().add(e1);
      rule.getElements().add(e2);
     
      // set all the attributes:
      e1.setAlias("e1");
      e2.setAlias("e2");
     
View Full Code Here

    }
   
    @Test
    public void testJoinFirstTupleList()
    {
      Rule rule = RuleModelFactory.eINSTANCE.createRule();
     
      BaseCondition bc1 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc2 = RuleModelFactory.eINSTANCE.createBaseCondition();
     
      List<BaseCondition> conditions = new ArrayList<BaseCondition>();
      conditions.add(bc1);
      conditions.add(bc2);
     
      ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
     
      rule.getElements().add(e1);
      rule.getElements().add(e2);
     
      // set all the attributes:
      e1.setAlias("e1");
      e2.setAlias("e2");
     
View Full Code Here

       *      BC4 e3
       *   </OR>
       * </AND>
       */
     
      Rule rule = RuleModelFactory.eINSTANCE.createRule();
     
      LogicCondition lc1 = RuleModelFactory.eINSTANCE.createLogicCondition();
      LogicCondition lc2 = RuleModelFactory.eINSTANCE.createLogicCondition();
     
      BaseCondition bc1 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc2 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc3 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc4 = RuleModelFactory.eINSTANCE.createBaseCondition();
     
      List<BaseCondition> conditions = new ArrayList<BaseCondition>();
      conditions.add(bc1);
      conditions.add(bc2);
      conditions.add(bc3);
      conditions.add(bc4);
     
      ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e3 = RuleModelFactory.eINSTANCE.createElementDefinition();
     
      rule.getElements().add(e1);
      rule.getElements().add(e2);
      rule.getElements().add(e3);
     
      e1.setAlias("e1");
      e2.setAlias("e2");
      e3.setAlias("e3");
     
      rule.setConditions(lc1);
     
      lc1.setType(LogicConditionType.AND);
      lc2.setType(LogicConditionType.OR);
     
      lc1.getBaseConditions().add(bc1);
View Full Code Here

    }
   
    @Test
    public void testJoinOneElementTuples()
    {
      Rule rule = RuleModelFactory.eINSTANCE.createRule();
     
      BaseCondition bc1 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc2 = RuleModelFactory.eINSTANCE.createBaseCondition();
     
      List<BaseCondition> conditions = new ArrayList<BaseCondition>();
      conditions.add(bc1);
      conditions.add(bc2);
     
      ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
     
      rule.getElements().add(e1);
      rule.getElements().add(e2);
     
      // set all the attributes:
      e1.setAlias("e1");
      e2.setAlias("e2");
     
View Full Code Here

    }
   
    @Test
    public void testJoinOR()
    {
      Rule rule = RuleModelFactory.eINSTANCE.createRule();

      /*
       * create the following rule:
       *
       * <OR>
       *  bc1
       *  bc2
       *  bc3
       * </OR>
       */
      LogicCondition lc = RuleModelFactory.eINSTANCE.createLogicCondition();
      BaseCondition bc1 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc2 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc3 = RuleModelFactory.eINSTANCE.createBaseCondition();
     
      rule.setConditions(lc);
      lc.getBaseConditions().add(bc1);
      lc.getBaseConditions().add(bc2);
      lc.getBaseConditions().add(bc3);
     
      List<BaseCondition> conditions = new ArrayList<BaseCondition>();
      conditions.add(bc1);
      conditions.add(bc2);
      conditions.add(bc3);
     
      ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
     
      rule.getElements().add(e1);
      rule.getElements().add(e2);
     
      // set all the attributes:
      e1.setAlias("e1");
      e2.setAlias("e2");
     
View Full Code Here

    }
   
    @Test
    public void testJoinTwoElementTuples()
    {
      Rule rule = RuleModelFactory.eINSTANCE.createRule();
     
      BaseCondition bc1 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc2 = RuleModelFactory.eINSTANCE.createBaseCondition();
     
      List<BaseCondition> conditions = new ArrayList<BaseCondition>();
      conditions.add(bc1);
      conditions.add(bc2);
     
      ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e3 = RuleModelFactory.eINSTANCE.createElementDefinition();
     
      rule.getElements().add(e1);
      rule.getElements().add(e2);
      rule.getElements().add(e3);
     
      // set all the attributes:
      e1.setAlias("e1");
      e2.setAlias("e2");
      e3.setAlias("e3");
View Full Code Here

    }
   
    @Test
    public void testRemoveOutdatedTuples()
    {
      Rule rule = RuleModelFactory.eINSTANCE.createRule();
     
      ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
     
      e1.setAlias("e1");
      e2.setAlias("e2");
     
      rule.getElements().add(e1);
      rule.getElements().add(e2);
     
      BaseCondition condition = RuleModelFactory.eINSTANCE.createBaseCondition();
      List<BaseCondition> conditions = new ArrayList<BaseCondition>();
      conditions.add(condition);
     
View Full Code Here

public class ElementResolverTest extends EMFTraceBaseTest
{       
    @Test
    public void testGetIndexForElement()
    {
        Rule rule = RuleModelFactory.eINSTANCE.createRule();     
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
       
        e1.setAlias("number_1");
        e2.setAlias("number_2");
       
        assertEquals(0, ElementResolver.getIndexForElement(rule, "number_1"));
View Full Code Here

       *      BC4 e3
       *   </OR>
       * </AND>
       */
     
      Rule rule = RuleModelFactory.eINSTANCE.createRule();
     
      LogicCondition lc1 = RuleModelFactory.eINSTANCE.createLogicCondition();
      LogicCondition lc2 = RuleModelFactory.eINSTANCE.createLogicCondition();
     
      BaseCondition bc1 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc2 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc3 = RuleModelFactory.eINSTANCE.createBaseCondition();
      BaseCondition bc4 = RuleModelFactory.eINSTANCE.createBaseCondition();
     
      List<BaseCondition> conditions = new ArrayList<BaseCondition>();
      conditions.add(bc1);
      conditions.add(bc2);
      conditions.add(bc3);
      conditions.add(bc4);
     
      ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
      ElementDefinition e3 = RuleModelFactory.eINSTANCE.createElementDefinition();
     
      ActionDefinition a = RuleModelFactory.eINSTANCE.createActionDefinition();
      a.setActionType(ActionType.CREATE_LINK);
       
      rule.getElements().add(e1);
      rule.getElements().add(e2);
      rule.getElements().add(e3);
     
      rule.getActions().add(a);
     
      e1.setAlias("e1");
      e2.setAlias("e2");
      e3.setAlias("e3");
     
      rule.setConditions(lc1);
     
      lc1.setType(LogicConditionType.AND);
      lc2.setType(LogicConditionType.OR);
     
      lc1.getBaseConditions().add(bc1);
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.RuleModel.Rule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.