Package org.emftrace.metamodel.ReportModel

Examples of org.emftrace.metamodel.ReportModel.ConsistenceReport


        ReportContainer c2 = ReportModelFactory.eINSTANCE.createReportContainer();
       
        accessLayer.addElement(project, c1);
        accessLayer.addElement(project, c2);
       
        ConsistenceReport r1 = ReportModelFactory.eINSTANCE.createConsistenceReport();
        ConsistenceReport r2 = ReportModelFactory.eINSTANCE.createConsistenceReport();
        ConsistenceReport r3 = ReportModelFactory.eINSTANCE.createConsistenceReport();
       
        accessLayer.addElement(project, r1);
        accessLayer.addElement(project, r2);
        accessLayer.addElement(project, r3);
       
        c1.getReports().add(r1);
        c1.getReports().add(r2);
        c1.getReports().add(r3);
       
        assertEquals(3, accessLayer.getElements(project, "ReportContainer").size());
        assertEquals(3, accessLayer.getElements(project, "ConsistenceReport").size());
        projectCleaner.updateReportContainer(project);
        assertEquals(1, accessLayer.getElements(project, "ReportContainer").size());
        assertEquals(3, accessLayer.getElements(project, "ConsistenceReport").size());
       
        ConsistenceReport r4 = ReportModelFactory.eINSTANCE.createConsistenceReport();
        accessLayer.addElement(project, r4);
       
        assertEquals(4, accessLayer.getElements(project, "ConsistenceReport").size());
        assertEquals(3, ((ReportContainer)accessLayer.getElements(project, "ReportContainer").get(0)).getReports().size());
        projectCleaner.updateReportContainer(project);
View Full Code Here


            container = ReportModelFactory.eINSTANCE.createReportContainer();
            accessLayer.addElement(project, container);
        }
        else container = (ReportContainer)helper.get(0);
       
        ConsistenceReport report = ReportModelFactory.eINSTANCE.createConsistenceReport();    
              
        accessLayer.addElement(project, report);
       
        container.getReports().add(report);
       
        report.setElement(model);
        report.setTypeOfViolation(violationType);
        report.setType(ReportType.VIOLATION);
       
        if( creator     != null ) report.setDetectedBy(creator);
        if( description != null ) report.setDescription(description);
        if( solution    != null ) report.setSolution(solution);
       
        return report;
  }
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));
     
      r.setType(ReportType.VIOLATION);
      assertTrue(reportManager.checkIfConsistenceReportAlreadyExists(project, a, t));
     
      r.setType(ReportType.BAD_SMELL);
      assertTrue(reportManager.checkIfConsistenceReportAlreadyExists(project, a, t));
    }
View Full Code Here

            container = ReportModelFactory.eINSTANCE.createReportContainer();
            accessLayer.addElement(project, container);
        }
        else container = (ReportContainer)helper.get(0);
       
        ConsistenceReport report = ReportModelFactory.eINSTANCE.createConsistenceReport();    
              
        accessLayer.addElement(project, report);
       
        container.getReports().add(report);
       
        report.setElement(model);
        report.setTypeOfViolation(violationType);
        report.setType(ReportType.VIOLATION);
       
        if( creator     != null ) report.setDetectedBy(creator);
        if( description != null ) report.setDescription(description);
        if( solution    != null ) report.setSolution(solution);
       
        return report;
  }
View Full Code Here

      {
      @Override
      public Void call() throws Exception
      {
          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));
         
          r.setType(ReportType.VIOLATION);
          assertTrue(reportManager.checkIfConsistenceReportAlreadyExists(project, a, t));
         
          r.setType(ReportType.BAD_SMELL);
          assertTrue(reportManager.checkIfConsistenceReportAlreadyExists(project, a, t));
        return null;
      }
    };
   
View Full Code Here

            ReportContainer c2 = ReportModelFactory.eINSTANCE.createReportContainer();
           
            accessLayer.addElement(project, c1);
            accessLayer.addElement(project, c2);
           
            ConsistenceReport r1 = ReportModelFactory.eINSTANCE.createConsistenceReport();
            ConsistenceReport r2 = ReportModelFactory.eINSTANCE.createConsistenceReport();
            ConsistenceReport r3 = ReportModelFactory.eINSTANCE.createConsistenceReport();
           
            accessLayer.addElement(project, r1);
            accessLayer.addElement(project, r2);
            accessLayer.addElement(project, r3);
           
            c1.getReports().add(r1);
            c1.getReports().add(r2);
            c1.getReports().add(r3);
           
            assertEquals(3, accessLayer.getElements(project, "ReportContainer").size());
            assertEquals(3, accessLayer.getElements(project, "ConsistenceReport").size());
            projectCleaner.updateReportContainer(project);
            assertEquals(1, accessLayer.getElements(project, "ReportContainer").size());
            assertEquals(3, accessLayer.getElements(project, "ConsistenceReport").size());
           
            ConsistenceReport r4 = ReportModelFactory.eINSTANCE.createConsistenceReport();
            accessLayer.addElement(project, r4);
           
            assertEquals(4, accessLayer.getElements(project, "ConsistenceReport").size());
            assertEquals(3, ((ReportContainer)accessLayer.getElements(project, "ReportContainer").get(0)).getReports().size());
            projectCleaner.updateReportContainer(project);
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.ReportModel.ConsistenceReport

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.