Package org.emftrace.metamodel.RuleModel

Examples of org.emftrace.metamodel.RuleModel.ElementDefinition


        action.setSourceElement("e1");
        action.setTargetElement("e2");
        action.setResultType("Test");
        action.setActionType(ActionType.CREATE_LINK);
       
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        accessLayer.addElement(project, e2);
        e1.setAlias("e1");
        e2.setAlias("e2");
        e1.setType("Concern");
        e2.setType("Concern");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
        rule.setRuleID("TestRule");
       
View Full Code Here


        action.setSourceElement("e1");
        action.setImpactedElement("e2");
        action.setResultType("Test");
        action.setActionType(ActionType.REPORT_IMPACT);
       
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
        ElementDefinition e3 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        accessLayer.addElement(project, e2);
        accessLayer.addElement(project, e3);
        e1.setAlias("e1");
        e2.setAlias("e2");
        e3.setAlias("e3");
        e1.setType("Concern");
        e2.setType("Concern");
        e3.setType("AtomicChangeType");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
        rule.getElements().add(e3);
        rule.setRuleID("TestRule");
View Full Code Here

        rule.setConditions(cnd1);
        cnd1.getBaseConditions().add(cnd2);
        cnd2.setSource("e1::Id");
        cnd2.setTarget("e2::Id");
       
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        accessLayer.addElement(project, e2);
        e1.setAlias("e1");
        e2.setAlias("e2");
        e1.setType("Concern");
        e2.setType("Actor");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
View Full Code Here

        rule.setConditions(cnd1);
        cnd1.getBaseConditions().add(cnd2);
        cnd2.setSource("Test");
        cnd2.setTarget("Test");
       
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        accessLayer.addElement(project, e2);
        e1.setAlias("e1");
        e2.setAlias("e2");
        e1.setType("Concern");
        e2.setType("Concern");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
        rule.setRuleID("TestRule");
       
View Full Code Here

        bc2.setValue("test");
       
        bc3.setSource("e1::name");
        bc3.setValue("test2");
       
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        accessLayer.addElement(project, e2);
        e1.setAlias("e1");
        e2.setAlias("e2");
        e1.setType("Concern");
        e2.setType("Concern");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
View Full Code Here

    }

    @Test
    public void testCheckElementDefinition()
    {
        ElementDefinition elemDef = RuleModelFactory.eINSTANCE.createElementDefinition();
        List<String> elements = new ArrayList<String>();
       
        assertFalse(ruleValidator.checkElementDefinition(elemDef, elements));
        elemDef.setAlias("");
        assertFalse(ruleValidator.checkElementDefinition(elemDef, elements));
        assertTrue(elements.isEmpty());
        elemDef.setAlias("e1");
        assertFalse(ruleValidator.checkElementDefinition(elemDef, elements));
        assertTrue(elements.isEmpty());
        elemDef.setType("");
        assertFalse(ruleValidator.checkElementDefinition(elemDef, elements));
        assertTrue(elements.isEmpty());
        elemDef.setType("Concern");
        assertTrue(ruleValidator.checkElementDefinition(elemDef, elements));
        assertFalse(elements.isEmpty());
    }
View Full Code Here

        rule.setConditions(cnd1);
        cnd1.getBaseConditions().add(cnd2);
        cnd2.setSource("e1::creator");
        cnd2.setTarget("e2::creator");
       
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        accessLayer.addElement(project, e2);
        e1.setAlias("e1");
        e2.setAlias("e2");
        e1.setType("Concern");
        e2.setType("Actor");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
View Full Code Here

        models.add(link);
       
        Rule rule = RuleModelFactory.eINSTANCE.createRule();
        accessLayer.addElement(project, rule);
       
        ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
        accessLayer.addElement(project, e1);
        e1.setType("TraceLink");
        rule.getElements().add(e1);
       
        assertEquals(1, results.size());
        assertEquals(0, results.get(0).size());
        elementProcessor.retrieveElements(project, rule, models, results);
        assertEquals(1, results.size());
        assertEquals(1, results.get(0).size());
        assertSame(link, results.get(0).get(0));
       
        Actor actor = URNModelFactory.eINSTANCE.createActor();
        accessLayer.addElement(project, actor);
        models.add(actor);
        results.get(0).clear();
        e1.setType("*");
       
        assertEquals(1, results.size());
        assertEquals(0, results.get(0).size());
        elementProcessor.retrieveElements(project, rule, models, results);
        assertEquals(1, results.size());
        assertEquals(2, results.get(0).size());
       
        results.get(0).clear();
        e1.setType("Actor");
       
        assertEquals(1, results.size());
        assertEquals(0, results.get(0).size());
        elementProcessor.retrieveElements(project, rule, models, results);
        assertEquals(1, results.size());
        assertEquals(1, results.get(0).size());
        assertSame(actor, results.get(0).get(0));
       
        results.get(0).clear();
        e1.setType("TraceLink|Actor");
       
        assertEquals(1, results.size());
        assertEquals(0, results.get(0).size());
        elementProcessor.retrieveElements(project, rule, models, results);
        assertEquals(1, results.size());
View Full Code Here

    @Test
    public void testRunProjectTraceRuleListOfListOfQueryElementListOfModelElement()
    {
        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();
View Full Code Here

    @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();
View Full Code Here

TOP

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

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.