Package org.emftrace.metamodel.URNModel

Examples of org.emftrace.metamodel.URNModel.Concern


      @Override
      public Void call() throws Exception
      {
            List<List<EObject>> result = new ArrayList<List<EObject>>();
                   
            Concern c1 = URNModelFactory.eINSTANCE.createConcern();
            Concern c2 = URNModelFactory.eINSTANCE.createConcern();
            accessLayer.addElement(project, c1);
            accessLayer.addElement(project, c2);
                  
            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 baseCondition1 = RuleModelFactory.eINSTANCE.createBaseCondition();
            BaseCondition baseCondition2 = RuleModelFactory.eINSTANCE.createBaseCondition();
            LogicCondition logicCondition = RuleModelFactory.eINSTANCE.createLogicCondition();
            accessLayer.addElement(project, baseCondition1);
            accessLayer.addElement(project, baseCondition2);
            accessLayer.addElement(project, logicCondition);
           
            rule.setConditions(logicCondition);
            logicCondition.getBaseConditions().add(baseCondition1);
            logicCondition.getBaseConditions().add(baseCondition2);
            baseCondition1.setSource("number_1::Id");
            baseCondition1.setTarget("number_2::Id");
            baseCondition1.setType(BaseConditionType.VALUE_EQUALS);
            baseCondition2.setSource("number_1::name");
            baseCondition2.setTarget("number_2::name");
            baseCondition2.setType(BaseConditionType.VALUE_EQUALS);
           
            List<List<EObject[]>> tuples = new ArrayList<List<EObject[]>>();
            tuples.add(new ArrayList<EObject[]>());
            tuples.add(new ArrayList<EObject[]>());
           
            // test "AND":
            c1.setId("creator");
            c2.setId("creator");
            c1.setName("name");
            c2.setName("name");
            logicCondition.setType(LogicConditionType.AND);
            assertTrue(conditionProcessor.executeLogicCondition(rule, result, rule.getConditions(), tuples));
            c1.setId("creator__");
            assertFalse(conditionProcessor.executeLogicCondition(rule, result, rule.getConditions(), tuples));
            result.get(0).clear();
            result.get(0).add(c1);
            result.get(1).clear();
            result.get(1).add(c2);
           
            // test "OR":
            logicCondition.setType(LogicConditionType.OR);
            assertTrue(conditionProcessor.executeLogicCondition(rule, result, rule.getConditions(), tuples));
            c2.setName("name___");
            assertFalse(conditionProcessor.executeLogicCondition(rule, result, rule.getConditions(), tuples));
            result.get(0).clear();
            result.get(0).add(c1);
            result.get(1).clear();
            result.get(1).add(c2);
           
            // test "XOR":
            c1.setId("creator");
            logicCondition.setType(LogicConditionType.XOR);
            assertTrue(conditionProcessor.executeLogicCondition(rule, result, rule.getConditions(), tuples));
            c1.setId("creator");
            c2.setId("creator");
            c1.setName("name");
            c2.setName("name");
            result.get(0).clear();
            result.get(0).add(c1);
            result.get(1).clear();
            result.get(1).add(c2);
            assertFalse(conditionProcessor.executeLogicCondition(rule, result, rule.getConditions(), tuples));
View Full Code Here


      @Override
      public Void call() throws Exception
      {
            List<List<EObject>> result = new ArrayList<List<EObject>>();
           
            Concern c1 = URNModelFactory.eINSTANCE.createConcern();
            Concern c2 = URNModelFactory.eINSTANCE.createConcern();
            accessLayer.addElement(project, c1);
            accessLayer.addElement(project, c2);
                  
            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 baseCondition1 = RuleModelFactory.eINSTANCE.createBaseCondition();
            BaseCondition baseCondition2 = RuleModelFactory.eINSTANCE.createBaseCondition();
            LogicCondition logicCondition = RuleModelFactory.eINSTANCE.createLogicCondition();
            accessLayer.addElement(project, baseCondition1);
            accessLayer.addElement(project, baseCondition2);
            accessLayer.addElement(project, logicCondition);
           
            rule.setConditions(logicCondition);
            logicCondition.getBaseConditions().add(baseCondition1);
            logicCondition.getBaseConditions().add(baseCondition2);
            baseCondition1.setSource("number_1::Id");
            baseCondition1.setTarget("number_2::Id");
            baseCondition1.setType(BaseConditionType.VALUE_EQUALS);
            baseCondition2.setSource("number_1::name");
            baseCondition2.setTarget("number_2::name");
            baseCondition2.setType(BaseConditionType.VALUE_EQUALS);
           
            c1.setId("1");
            c2.setId("1");
            c1.setName("name");
            c2.setName("name");
            logicCondition.setType(LogicConditionType.AND);
           
            List<List<EObject[]>> tuples = new ArrayList<List<EObject[]>>();
            tuples.add(new ArrayList<EObject[]>());
            tuples.add(new ArrayList<EObject[]>());
View Full Code Here

      @Override
      public Void call() throws Exception
      {
            List<List<EObject>> result = new ArrayList<List<EObject>>();
           
            Concern c1 = URNModelFactory.eINSTANCE.createConcern();
            Concern c2 = URNModelFactory.eINSTANCE.createConcern();
            Concern c3 = c1;
            accessLayer.addElement(project, c1);
            accessLayer.addElement(project, c2);
                  
            result.add(new ArrayList<EObject>());
            result.get(0).add(c1);
View Full Code Here

      @Override
      public Void call() throws Exception
      {
            List<List<EObject>> result = new ArrayList<List<EObject>>();
           
            Concern c1 = URNModelFactory.eINSTANCE.createConcern();
            Concern c2 = URNModelFactory.eINSTANCE.createConcern();
            Concern c3 = URNModelFactory.eINSTANCE.createConcern();
            accessLayer.addElement(project, c1);
            accessLayer.addElement(project, c2);
            accessLayer.addElement(project, c3);
           
            TraceLink l1 = LinkModelFactory.eINSTANCE.createTraceLink();
View Full Code Here

      @Override
      public Void call() throws Exception
      {
            List<List<EObject>> result = new ArrayList<List<EObject>>();
           
            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

           *  \     \__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

      Callable<Void> call = new Callable<Void>()
      {
      @Override
      public Void call() throws Exception
      {
            Concern test = URNModelFactory.eINSTANCE.createConcern();
            project.getContents().clear();
           
            assertEquals("Result", 0, project.getContents().size());
            accessLayer.addElement(project, test);
            assertEquals("Result", 1, project.getContents().size());
View Full Code Here

      Callable<Void> call = new Callable<Void>()
      {
      @Override
      public Void call() throws Exception
      {
            Concern test = URNModelFactory.eINSTANCE.createConcern();
            test.setId("123");
            accessLayer.addElement(project, test);       
            assertNotNull(accessLayer.getAttribute(test, "Id"));
           
            assertNull(accessLayer.getAttribute(null, "creator"));
            assertNull(accessLayer.getAttribute(test, null));
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();
            Concern c3 = URNModelFactory.eINSTANCE.createConcern();
            accessLayer.addElement(project, c1);
            accessLayer.addElement(project, c2);
            accessLayer.addElement(project, c3);
                       
            assertEquals(3, accessLayer.getAllElements(project).size());
View Full Code Here

      Callable<Void> call = new Callable<Void>()
      {
      @Override
      public Void call() throws Exception
      {
            Concern test = URNModelFactory.eINSTANCE.createConcern();
            project.getContents().clear();
           
            assertEquals("Result", 0, project.getContents().size());
            accessLayer.addElement(project, test);
            assertEquals("Result", 1, project.getContents().size());
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.