Package org.emftrace.metamodel.URNModel

Examples of org.emftrace.metamodel.URNModel.Concern


          e2.setAlias("e2");
         
          List<EObject[]> finalTuples   = new ArrayList<EObject[]>();
          List<EObject[]> currentTuples = new ArrayList<EObject[]>();
         
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
              
          bc1.setSource("e1");
          bc1.setTarget("e2");
          bc2.setSource("e2");     
          bc2.setTarget("e3");
View Full Code Here


          tuples.add(new ArrayList<EObject[]>()); // bc1
          tuples.add(new ArrayList<EObject[]>()); // bc2
          tuples.add(new ArrayList<EObject[]>()); // bc3
          tuples.add(new ArrayList<EObject[]>()); // bc4
         
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
          Concern c3 = URNModelFactory.eINSTANCE.createConcern();
          Concern c4 = URNModelFactory.eINSTANCE.createConcern();
          Concern c5 = URNModelFactory.eINSTANCE.createConcern();
          Concern c6 = URNModelFactory.eINSTANCE.createConcern();
          Concern c7 = URNModelFactory.eINSTANCE.createConcern();
          Concern c8 = URNModelFactory.eINSTANCE.createConcern();
         
          tuples.get(0).add(new EObject[2]); // bc1 tuple 1
          tuples.get(0).get(0)[0] = c1;
          tuples.get(0).get(0)[1] = c2;
          tuples.get(0).add(new EObject[2]); // bc1 tuple 2
View Full Code Here

          e2.setAlias("e2");
         
          List<EObject[]> finalTuples   = new ArrayList<EObject[]>();
          List<EObject[]> currentTuples = new ArrayList<EObject[]>();
         
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
          Concern c3 = URNModelFactory.eINSTANCE.createConcern();
          Concern c4 = URNModelFactory.eINSTANCE.createConcern();
              
          bc1.setSource("e1");
          bc1.setTarget("e2");
          bc2.setSource("e2");
         
View Full Code Here

          bc3.setSource("e1");
          bc1.setTarget("e2");
          bc2.setTarget("e2");
          bc3.setTarget("e2");
         
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
          Concern c3 = URNModelFactory.eINSTANCE.createConcern();
          Concern c4 = URNModelFactory.eINSTANCE.createConcern();
          Concern c5 = URNModelFactory.eINSTANCE.createConcern();
          Concern c6 = URNModelFactory.eINSTANCE.createConcern();
          Concern c7 = URNModelFactory.eINSTANCE.createConcern();
          Concern c8 = URNModelFactory.eINSTANCE.createConcern();
         
          List<EObject[]>       results = new ArrayList<EObject[]>();
          List<List<EObject[]>> tuples  = new ArrayList<List<EObject[]>>();
         
          tuples.add(new ArrayList<EObject[]>());
View Full Code Here

          e3.setAlias("e3");
         
          List<EObject[]> finalTuples   = new ArrayList<EObject[]>();
          List<EObject[]> currentTuples = new ArrayList<EObject[]>();
         
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
          Concern c3 = URNModelFactory.eINSTANCE.createConcern();
         
          // test the case that the final tuple list is empty:
         
          bc1.setSource("e1");
          bc1.setTarget("e2");
View Full Code Here

          conditions.add(condition);
         
          condition.setSource("e1");
          condition.setTarget("e2");
         
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
          Concern c3 = URNModelFactory.eINSTANCE.createConcern();
          Concern c4 = URNModelFactory.eINSTANCE.createConcern();
         
          List<List<EObject>> results = new ArrayList<List<EObject>>();
          results.add(new ArrayList<EObject>());
          results.add(new ArrayList<EObject>());
         
View Full Code Here

      Callable<Void> call = new Callable<Void>()
      {
      @Override
      public Void call() throws Exception
      {
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
         
          List<EObject[]> tuples = new ArrayList<EObject[]>();
         
          tuples.add(new EObject[2]);
          tuples.add(new EObject[2]);
View Full Code Here

      public Void call() throws Exception
      {
          List<EObject[]> joinedTuples = new ArrayList<EObject[]>();
          List<EObject[]> tupleList    = new ArrayList<EObject[]>();
   
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
          Concern c3 = URNModelFactory.eINSTANCE.createConcern();
          Concern c4 = URNModelFactory.eINSTANCE.createConcern();
          Concern c5 = URNModelFactory.eINSTANCE.createConcern();
          Concern c6 = URNModelFactory.eINSTANCE.createConcern();
          Concern c7 = URNModelFactory.eINSTANCE.createConcern();
         
          joinedTuples.add(new EObject[3]);
          joinedTuples.get(0)[0] = c1;
          joinedTuples.get(0)[1] = c2;
          joinedTuples.get(0)[2] = null;
View Full Code Here

          tuples.add(new ArrayList<EObject[]>()); // bc1
          tuples.add(new ArrayList<EObject[]>()); // bc2
          tuples.add(new ArrayList<EObject[]>()); // bc3
          tuples.add(new ArrayList<EObject[]>()); // bc4
         
          Concern c1 = URNModelFactory.eINSTANCE.createConcern();
          Concern c2 = URNModelFactory.eINSTANCE.createConcern();
          Concern c3 = URNModelFactory.eINSTANCE.createConcern();
          Concern c4 = URNModelFactory.eINSTANCE.createConcern();
          Concern c5 = URNModelFactory.eINSTANCE.createConcern();
          Concern c6 = URNModelFactory.eINSTANCE.createConcern();
          Concern c7 = URNModelFactory.eINSTANCE.createConcern();
          Concern c8 = URNModelFactory.eINSTANCE.createConcern();
         
          List<List<EObject>> results = new ArrayList<List<EObject>>();
          results.add(new ArrayList<EObject>()); // e1
          results.add(new ArrayList<EObject>()); // e2
          results.add(new ArrayList<EObject>()); // e3
View Full Code Here

      public Void call() throws Exception
      {
            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"
            c1.setId("test");
            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.