Package org.emftrace.metamodel.LinkModel

Examples of org.emftrace.metamodel.LinkModel.LinkType


    }
   
    @Test
    public void testCleanUpLinkTypeOrphansProject()
    {
        LinkType t1 = LinkModelFactory.eINSTANCE.createLinkType();
        LinkType t2 = LinkModelFactory.eINSTANCE.createLinkType();
       
        accessLayer.addElement(project, t1);
        accessLayer.addElement(project, t2);
       
        LinkTypeCatalog c1 = LinkModelFactory.eINSTANCE.createLinkTypeCatalog();
       
        accessLayer.addElement(project, c1);
       
        c1.getLinkTypes().add(t1);
       
        assertEquals(1, c1.getLinkTypes().size());
        assertEquals(1, accessLayer.getElements(project, "LinkTypeCatalog").size());
        assertEquals(2, accessLayer.getElements(project, "LinkType").size());
        projectCleaner.cleanUpLinkTypeOrphans(project);
        assertEquals(1, c1.getLinkTypes().size());
        assertEquals(2, accessLayer.getElements(project, "LinkType").size());
        assertEquals(2, accessLayer.getElements(project, "LinkTypeCatalog").size());
       
        LinkType t3 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, t3);
       
        assertEquals(3, accessLayer.getElements(project, "LinkType").size());
        projectCleaner.cleanUpLinkTypeOrphans(project);
        assertEquals(3, accessLayer.getElements(project, "LinkType").size());
View Full Code Here


    }
   
    @Test
    public void testUpdateLinkTypeCatalogsProject()
    {
        LinkType t1 = LinkModelFactory.eINSTANCE.createLinkType();
        LinkType t2 = LinkModelFactory.eINSTANCE.createLinkType();
       
        accessLayer.addElement(project, t1);
        accessLayer.addElement(project, t2);
       
        LinkTypeCatalog c1 = LinkModelFactory.eINSTANCE.createLinkTypeCatalog();
View Full Code Here

            {
                if( isLoggingEnabled ) printToLog("checkActionDefinition", "linktype is empty String");
                return false;  
            }
           
            LinkType linktype = null;
            List<EObject> list = accessLayer.getElements(project, "LinkType");
            for(int i = 0; i < list.size(); i++)
            {
                if( (((LinkType) (list.get(i))).getName()).equals(type) )
                {
View Full Code Here

       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
        rule.setRuleID("TestRule");
       
        LinkType type = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, type);
        type.setName("Test_");
       
        List<EObject[]> tuples = new ArrayList<EObject[]>();
       
        tuples.add(new EObject[2]);
        tuples.get(0)[0] = c1;
        tuples.get(0)[1] = c2;
       
        assertEquals(0, accessLayer.getElements(project, "TraceLink").size());
        resultProcessor.processCreateLinkResult(project, rule, result, tuples, 0);
        assertEquals(0, accessLayer.getElements(project, "TraceLink").size());
       
        type.setName("Test");
       
        resultProcessor.processCreateLinkResult(project, rule, result, tuples, 0);
        assertEquals(1, accessLayer.getElements(project, "TraceLink").size());
        resultProcessor.processCreateLinkResult(project, rule, result, tuples, 0);
        assertEquals(1, accessLayer.getElements(project, "TraceLink").size());
       
        type.setName("Test_");
       
        resultProcessor.processCreateLinkResult(project, rule, result, tuples, 0);
        assertEquals(1, accessLayer.getElements(project, "TraceLink").size());
    }
View Full Code Here

       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
        rule.setRuleID("TestRule");
       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l1);
        l1.setName("Test");
       
        ActionDefinition a1 = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, a1);
        a1.setSourceElement("e1");
        a1.setTargetElement("e2");
View Full Code Here

        e2.setType("Actor");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l1);
        l1.setName("Test");
       
        ActionDefinition a1 = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, a1);
        a1.setSourceElement("e1");
        a1.setTargetElement("e2");
View Full Code Here

        e2.setType("Concern");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l1);
        l1.setName("Test");
       
        LinkType l2 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l2);
        l2.setName("TestRelation");
       
        ActionDefinition a1 = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, a1);
        a1.setSourceElement("e1");
        a1.setTargetElement("e2");
View Full Code Here

        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        elements.add("e2");
        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        actionDef.setResultType("test");
        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        LinkType linkType = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, linkType);
        linkType.setName("test");
        assertTrue(ruleValidator.checkActionDefinition(project, actionDef, elements));
    }
View Full Code Here

        e2.setType("Actor");
       
        rule.getElements().add(e1);
        rule.getElements().add(e2);
       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l1);
        l1.setName("Test");
       
        ActionDefinition a1 = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, a1);
        a1.setSourceElement("e1");
        a1.setTargetElement("e2");
View Full Code Here

         int dstIdx = ElementResolver.getIndexForElement(rule, rule.getActions().get(index).getTargetElement());
        
         if( results.get(srcIdx).isEmpty() || results.get(dstIdx).isEmpty()) return;
        
         // get the appropriate LinkType:
         LinkType      type = null;
         List<EObject> list = accessLayer.getElements(project, "LinkType");
         for(int j = 0; j < list.size(); j++)
         {
             if( (((LinkType) (list.get(j))).getName()).equals(rule.getActions().get(index).getResultType()) )
             {
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.LinkModel.LinkType

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.