Examples of ImpactReport


Examples of org.emftrace.metamodel.ReportModel.ImpactReport

    if( sources        == null   ) return null;
    if( affectedModels == null   ) return null;
    if( sources.isEmpty()        ) return null;
    if( affectedModels.isEmpty() ) return null;
   
    ImpactReport report = ReportModelFactory.eINSTANCE.createImpactReport();
   
    ReportContainer container = null;   
              
        if( saveToEMFStore )
        {
            List<EObject> helper    = accessLayer.getElements(project, "ReportContainer");
            if( helper.isEmpty() )         
            {
                container = ReportModelFactory.eINSTANCE.createReportContainer();
                accessLayer.addElement(project, container);
            }
            else container = (ReportContainer)helper.get(0);
           
          accessLayer.addElement(project, report);
          container.getReports().add(report);
        }
               
        report.getImpactSources().addAll(sources);
        report.getAffectedElements().addAll(affectedModels);
        report.setType(ReportType.IMPACT);

        if( changeType  != null ) report.setChangeType(changeType);
        if( creator     != null ) report.setDetectedBy(creator);
        if( description != null ) report.setDescription(description);
        if( solution    != null ) report.setSolution(solution);
       
        return report;
  }
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ImpactReport

   
    @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);
      assertTrue(reportManager.checkIfImpactReportAlreadyExists(project, l1, l2, c));
      r.setType(ReportType.VIOLATION);
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(project, l1, l2, c));
      r.setType(ReportType.BAD_SMELL);
      assertFalse(reportManager.checkIfImpactReportAlreadyExists(project, l1, l2, c));
    }
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ImpactReport

   
    for(int i = 0; i < impacts.size(); i++)
    {
      item = new MenuItem(menu, SWT.PUSH);
      item.setText("Open impact report " + (i+1));
      final ImpactReport impact = impacts.get(i);
      item.addSelectionListener(new SelectionListener()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
        {
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ImpactReport

   
    for(int i = 0; i < impacts.size(); i++)
    {
      item = new MenuItem(menu, SWT.PUSH);
      item.setText("Open impact report " + (i+1));
      final ImpactReport impact = impacts.get(i);
      item.addSelectionListener(new SelectionListener()
      {
        @Override
        public void widgetSelected(SelectionEvent e)
        {
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ImpactReport

    if( sources        == null   ) return null;
    if( affectedModels == null   ) return null;
    if( sources.isEmpty()        ) return null;
    if( affectedModels.isEmpty() ) return null;
   
    ImpactReport report = ReportModelFactory.eINSTANCE.createImpactReport();
   
    ReportContainer container = null;   
              
        if( saveToEMFStore )
        {
            List<EObject> helper    = accessLayer.getElements(project, "ReportContainer");
            if( helper.isEmpty() )         
            {
                container = ReportModelFactory.eINSTANCE.createReportContainer();
                accessLayer.addElement(project, container);
            }
            else container = (ReportContainer)helper.get(0);
           
          accessLayer.addElement(project, report);
          container.getReports().add(report);
        }
               
        report.getImpactSources().addAll(sources);
        report.getAffectedElements().addAll(affectedModels);
        report.setType(ReportType.IMPACT);

        if( changeType  != null ) report.setChangeType(changeType);
        if( creator     != null ) report.setDetectedBy(creator);
        if( description != null ) report.setDescription(description);
        if( solution    != null ) report.setSolution(solution);
       
        return report;
  }
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ImpactReport

      {
      @Override
      public Void call() throws Exception
      {
          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);
          assertTrue(reportManager.checkIfImpactReportAlreadyExists(project, l1, l2, c));
          r.setType(ReportType.VIOLATION);
          assertFalse(reportManager.checkIfImpactReportAlreadyExists(project, l1, l2, c));
          r.setType(ReportType.BAD_SMELL);
          assertFalse(reportManager.checkIfImpactReportAlreadyExists(project, l1, l2, c));
        return null;
      }
    };
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.