Package org.emftrace.metamodel.URNModel

Examples of org.emftrace.metamodel.URNModel.Actor


    @Test
    public void testApplyRule()
    {
        Concern c1 = URNModelFactory.eINSTANCE.createConcern();
        Actor   c2 = URNModelFactory.eINSTANCE.createActor();
        accessLayer.addElement(project, c1);
        accessLayer.addElement(project, c2);
       
        c1.setId("test_user");
        c2.setId("test_user");
               
        Rule rule = RuleModelFactory.eINSTANCE.createRule();
        accessLayer.addElement(project, rule);
       
        LogicCondition cnd1 = RuleModelFactory.eINSTANCE.createLogicCondition();
View Full Code Here


        elementProcessor.retrieveElements(project, "TraceLink", list);
        assertEquals(1, list.size());
        assertSame(link, list.get(0));
        list.clear();
       
        Actor actor = URNModelFactory.eINSTANCE.createActor();
        accessLayer.addElement(project, actor);
       
        assertEquals(0, list.size());
        elementProcessor.retrieveElements(project, "TraceLink|Actor", list);
        assertEquals(2, list.size());
View Full Code Here

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

   
    @Test
    public void testGetAttributeValueModelElementStringString()
    {       
        TraceLink link = LinkModelFactory.eINSTANCE.createTraceLink();
        Actor actor = URNModelFactory.eINSTANCE.createActor();
       
        actor.setId("123");
       
        link.setSource(actor);

        assertEquals("Result", "123", accessLayer.getAttributeValue(link.getSource(), "Id"));
        actor.setId("1234");
        assertEquals("Result", "1234", accessLayer.getAttributeValue(link.getSource(), "Id"));
        assertNull(accessLayer.getAttributeValue(null, (String)null, (String)null));
        assertNull(accessLayer.getAttributeValue(link.getSource(), (String)null, (String)null));
        assertNull(accessLayer.getAttributeValue(link.getSource(), (String)null, "Id"));
        assertNull(accessLayer.getAttributeValue(link.getSource(), (String)null));
View Full Code Here

    }
   
    @Test
    public void testCreateImpactReport()
    {
      Actor a1 = URNModelFactory.eINSTANCE.createActor();
      Actor a2 = URNModelFactory.eINSTANCE.createActor();
      AtomicChangeType c = ChangeModelFactory.eINSTANCE.createAtomicChangeType();
     
      List<EObject> l1 = new ArrayList<EObject>();
      List<EObject> l2 = new ArrayList<EObject>();
      l1.add(a1);
View Full Code Here

    }
   
    @Test
    public void testCreateConsistenceReport()
    {
      Actor a = URNModelFactory.eINSTANCE.createActor();
      ViolationType t = ReportModelFactory.eINSTANCE.createViolationType();
     
      // test the negative cases:
      assertEquals(0, accessLayer.getElements(project, "ConsistenceReport").size());
      reportManager.createConsistenceReport(null, null, null, null, null, null);
View Full Code Here

    @Test
    public void testCheckIfImpactReportAlreadyExists()
    {
      ReportContainer container = ReportModelFactory.eINSTANCE.createReportContainer();
      ImpactReport r = ReportModelFactory.eINSTANCE.createImpactReport();
      Actor a1 = URNModelFactory.eINSTANCE.createActor();
      Actor a2 = URNModelFactory.eINSTANCE.createActor();
      AtomicChangeType c = ChangeModelFactory.eINSTANCE.createAtomicChangeType();
      LinkType t = LinkModelFactory.eINSTANCE.createLinkType();
     
      List<EObject> l1 = new ArrayList<EObject>();
      List<EObject> l2 = new ArrayList<EObject>();
      l1.add(a1);
      l2.add(a2);
     
      t.setName("TestRelation");
      c.setType(AtomicType.ADD);
      r.getImpactSources().add(a1);
      r.getAffectedElements().add(a2);
      r.setChangeType(c);
      r.setType(ReportType.IMPACT);
      container.getReports().add(r);
     
      accessLayer.addElement(project, container);
     
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, null, null, null));
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(project, null, null, null));
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, l1, null, null));
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, null, l2, null));
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, null, null, c));
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, null, null, null));
      // ... continue this ...
     
      Actor a3 = URNModelFactory.eINSTANCE.createActor();
      r.getImpactSources().clear();
      r.getImpactSources().add(a3);
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(project, l1, l2, c));
      r.getImpactSources().clear();
      r.getImpactSources().add(a1);
View Full Code Here

    @Test
    public void testCheckIfConsistenceReportAlreadyExists()
    {
      ReportContainer container = ReportModelFactory.eINSTANCE.createReportContainer();
      ConsistenceReport r = ReportModelFactory.eINSTANCE.createConsistenceReport();
      Actor a = URNModelFactory.eINSTANCE.createActor();
      ViolationType t = ReportModelFactory.eINSTANCE.createViolationType();
     
      t.setName("TestViolationType");
      r.setTypeOfViolation(t);
      r.setType(ReportType.VIOLATION);
      r.setElement(a);
     
      container.getReports().add(r);
      accessLayer.addElement(project, container);
          
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(null, null, null));
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, null, null));
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, a, null));
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(null, a, t));
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, null, t));
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, a, null));
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(null, null, t));
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(null, a, null));
     
      Actor a2 = URNModelFactory.eINSTANCE.createActor();
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, a2, t));
     
      r.setType(ReportType.IMPACT);
      assertFalse(reportManager.checkIfConsistenceReportAlreadyExists(project, a, t));
     
View Full Code Here

        e2.setAlias("e2");
        e1.setType("TraceLink");
        e2.setType("Actor");
       
        TraceLink link  = LinkModelFactory.eINSTANCE.createTraceLink();
        Actor     actor = URNModelFactory.eINSTANCE.createActor();
       
        accessLayer.addElement(project, link);
        accessLayer.addElement(project, actor);
             
        link.setSource(actor);
View Full Code Here

            e2.setAlias("e2");
            e1.setType("TraceLink");
            e2.setType("Actor");
           
            TraceLink link  = LinkModelFactory.eINSTANCE.createTraceLink();
            Actor     actor = URNModelFactory.eINSTANCE.createActor();
           
            accessLayer.addElement(project, link);
            accessLayer.addElement(project, actor);
                 
            link.setSource(actor);
View Full Code Here

TOP

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

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.