Package org.emftrace.metamodel.URNModel

Examples of org.emftrace.metamodel.URNModel.Concern


        List<List<EObject>> l2 = new ArrayList<List<EObject>>();
       
        List<List<EObject>> result = new ArrayList<List<EObject>>();
        result.add(new ArrayList<EObject>());
       
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
       
        l1.add(new ArrayList<EObject>());
        l1.get(0).add(c1);
        l2.add(new ArrayList<EObject>());
        l2.get(0).add(c2);
View Full Code Here


    @Test
    public void testAddToTuples()
    {
      List<EObject[]> tuples = new ArrayList<EObject[]>();
     
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
       
        assertTrue(tuples.isEmpty());
        ConditionProcessorHelper.addToTuples(c1, c2, tuples);
        assertEquals(1, tuples.size());
        assertEquals(2, tuples.get(0).length);
View Full Code Here

    @Test
    public void testCreateDeepCopyOfTupleList()
    {
         List<EObject[]> tuples = new ArrayList<EObject[]>();
        
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
       
        tuples.add(new EObject[2]);
        tuples.get(0)[0] = c1;
        tuples.get(0)[1] = c2;
       
View Full Code Here

    public void testCreateDeepCopyOfTupleList2()
    {
      List<List<EObject[]>> tuples = new ArrayList<List<EObject[]>>();
      List<List<EObject[]>> copy = null;
     
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
        Concern c3 = URNModelFactory.eINSTANCE.createConcern();
       
        tuples.add(new ArrayList<EObject[]>());
        tuples.add(new ArrayList<EObject[]>());
       
        tuples.get(0).add(new EObject[2]);
View Full Code Here

    public void testCreateTupleListDiff()
    {
         List<EObject[]> tuples = new ArrayList<EObject[]>();
         List<EObject[]> copy = new ArrayList<EObject[]>();
        
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
        Concern c3 = URNModelFactory.eINSTANCE.createConcern();
        Concern c4 = URNModelFactory.eINSTANCE.createConcern();
       
        tuples.add(new EObject[1]);
        tuples.get(0)[0] = c1;
       
        tuples.add(new EObject[1]);
View Full Code Here

     
      lc1.getLogicConditions().add(lc2);
      lc1.getBaseConditions().add(bc1);
      lc2.getBaseConditions().add(bc2);
     
      Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
        Concern c3 = URNModelFactory.eINSTANCE.createConcern();
        Concern c4 = URNModelFactory.eINSTANCE.createConcern();
       
      accessLayer.addElement(project, c1);
      accessLayer.addElement(project, c2);
      accessLayer.addElement(project, c3);
      accessLayer.addElement(project, c4);
View Full Code Here

    public void testEqualizeTupleLists()
    {
      List<EObject[]> tuples = new ArrayList<EObject[]>();
      List<EObject[]> copy   = new ArrayList<EObject[]>();
     
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
        Concern c3 = URNModelFactory.eINSTANCE.createConcern();
       
        tuples.add(new EObject[2]);
        tuples.get(0)[0] = c1;
        tuples.get(0)[1] = c2;
       
View Full Code Here

    @Test
    public void testRemoveFromTuples()
    {
      List<EObject[]> tuples = new ArrayList<EObject[]>();
     
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
        Concern c3 = URNModelFactory.eINSTANCE.createConcern();
        Concern c4 = URNModelFactory.eINSTANCE.createConcern();
       
        tuples.add(new EObject[2]);
        tuples.get(0)[0] = c1;
        tuples.get(0)[1] = c2;
       
View Full Code Here

       *  \     \__A4
       *   \__A5
       *
       */
     
      Concern a1 = URNModelFactory.eINSTANCE.createConcern();
      Concern a2 = URNModelFactory.eINSTANCE.createConcern();
      Concern a3 = URNModelFactory.eINSTANCE.createConcern();
      Concern a4 = URNModelFactory.eINSTANCE.createConcern();
      Concern a5 = URNModelFactory.eINSTANCE.createConcern();
      Concern a6 = URNModelFactory.eINSTANCE.createConcern();
      Concern a7 = URNModelFactory.eINSTANCE.createConcern();
      Concern a8 = URNModelFactory.eINSTANCE.createConcern();
      Concern a9 = URNModelFactory.eINSTANCE.createConcern();
     
      TraceLink linkA1_A2 = LinkModelFactory.eINSTANCE.createTraceLink();
      TraceLink linkA1_A6 = LinkModelFactory.eINSTANCE.createTraceLink();
      TraceLink linkA1_A5 = LinkModelFactory.eINSTANCE.createTraceLink();
      TraceLink linkA2_A3 = LinkModelFactory.eINSTANCE.createTraceLink();
View Full Code Here

    public void testExecuteBaseCondition()
    {       
        List<List<EObject>> result = new ArrayList<List<EObject>>();
        result.add(new ArrayList<EObject>());
       
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Concern c2 = URNModelFactory.eINSTANCE.createConcern();
        accessLayer.addElement(project, c1);
        accessLayer.addElement(project, c2);
       
        c1.setId("test");
        c2.setId("test");
       
        result.add(new ArrayList<EObject>());
        result.get(0).add(c1);
        result.add(new ArrayList<EObject>());
        result.get(1).add(c2);
       
        Rule rule = RuleModelFactory.eINSTANCE.createRule();
        accessLayer.addElement(project, rule);
       
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e2);
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
       
        e1.setAlias("number_1");
        e2.setAlias("number_2");
       
        BaseCondition baseCondition = RuleModelFactory.eINSTANCE.createBaseCondition();
        LogicCondition logicCondition = RuleModelFactory.eINSTANCE.createLogicCondition();
        accessLayer.addElement(project, baseCondition);
        accessLayer.addElement(project, logicCondition);
       
        rule.setConditions(logicCondition);
        logicCondition.getBaseConditions().add(baseCondition);
        logicCondition.setType(LogicConditionType.AND);
        baseCondition.setSource("number_1::Id");
        baseCondition.setTarget("number_2::Id");
       
        List<EObject[]> tuples = new ArrayList<EObject[]>();
       
        // test "EQUALS":
        baseCondition.setType(BaseConditionType.VALUE_EQUALS);       
        assertTrue(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        assertEquals(1, result.get(0).size()); // test this once...
        assertEquals(1, result.get(1).size());
        c1.setId("test_addition");
        assertFalse(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        assertEquals(0, result.get(0).size());
        assertEquals(0, result.get(1).size());
        result.get(0).clear();
        result.get(0).add(c1);
        result.get(1).clear();
        result.get(1).add(c2);
       
        // test "STARTS_WITH":
        c1.setId("test_bla");
        baseCondition.setType(BaseConditionType.VALUE_STARTS_WITH);       
        assertTrue(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        c1.setId("bla");
        assertFalse(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        result.get(0).clear();
        result.get(0).add(c1);
        result.get(1).clear();
        result.get(1).add(c2);
       
        // test "ENDS_WITH":
        c1.setId("test");
        baseCondition.setType(BaseConditionType.VALUE_ENDS_WITH);       
        assertTrue(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        c1.setId("test_bla");
        assertFalse(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        result.get(0).clear();
        result.get(0).add(c1);
        result.get(1).clear();
        result.get(1).add(c2);
       
        // test "CONTAINS":
        c1.setId("test_addition");
        baseCondition.setType(BaseConditionType.VALUE_CONTAINS);       
        assertTrue(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        c1.setId("tes");
        assertFalse(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        result.get(0).clear();
        result.get(0).add(c1);
        result.get(1).clear();
        result.get(1).add(c2);
       
        // test "SIMILAR_TO"
        conditionProcessor.setCorrelation(0.5f);
        c1.setId("test1");
        baseCondition.setType(BaseConditionType.VALUE_SIMILAR_TO);       
        assertTrue(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        c1.setId("tast");
        assertFalse(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        result.get(0).clear();
        result.get(0).add(c1);
        result.get(1).clear();
        result.get(1).add(c2);
               
        // test "LESSER_THAN":
        c1.setId("1");
        c2.setId("2");
        baseCondition.setType(BaseConditionType.VALUE_LESSER_THAN);
        assertTrue(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        c1.setId("2");
        c2.setId("1");
        assertFalse(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        result.get(0).clear();
        result.get(0).add(c1);
        result.get(1).clear();
        result.get(1).add(c2);
       
        // test "GREATER_THAN":
        c1.setId("2");
        c2.setId("1");
        baseCondition.setType(BaseConditionType.VALUE_GREATER_THAN);
        assertTrue(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
        c1.setId("1");
        c2.setId("2");
        assertFalse(conditionProcessor.executeBaseCondition(rule, result, baseCondition, tuples));
       
        // test "IS_PARENT":
        result.get(0).clear();
        result.get(0).add(rule);
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.URNModel.Concern

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.