Examples of ViolationType


Examples of org.emftrace.metamodel.ReportModel.ViolationType

    }

    @Test
    public void testCleanUpViolationTypeOrphansProject()
    {
        ViolationType t1 = ReportModelFactory.eINSTANCE.createViolationType();
        ViolationType t2 = ReportModelFactory.eINSTANCE.createViolationType();
       
        accessLayer.addElement(project, t1);
        accessLayer.addElement(project, t2);
       
        ViolationTypeCatalog c1 = ReportModelFactory.eINSTANCE.createViolationTypeCatalog();
       
        accessLayer.addElement(project, c1);
       
        c1.getViolationTypes().add(t1);
       
        assertEquals(1, c1.getViolationTypes().size());
        assertEquals(1, accessLayer.getElements(project, "ViolationTypeCatalog").size());
        assertEquals(2, accessLayer.getElements(project, "ViolationType").size());
        projectCleaner.cleanUpViolationTypeOrphans(project);
        assertEquals(1, c1.getViolationTypes().size());
        assertEquals(2, accessLayer.getElements(project, "ViolationType").size());
        assertEquals(2, accessLayer.getElements(project, "ViolationTypeCatalog").size());
       
        ViolationType t3 = ReportModelFactory.eINSTANCE.createViolationType();
        accessLayer.addElement(project, t3);
       
        assertEquals(3, accessLayer.getElements(project, "ViolationType").size());
        projectCleaner.cleanUpViolationTypeOrphans(project);
        assertEquals(3, accessLayer.getElements(project, "ViolationType").size());
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ViolationType

    }
   
    @Test
    public void testUpdateViolationTypeCatalogsProject()
    {
        ViolationType t1 = ReportModelFactory.eINSTANCE.createViolationType();
        ViolationType t2 = ReportModelFactory.eINSTANCE.createViolationType();
       
        accessLayer.addElement(project, t1);
        accessLayer.addElement(project, t2);
       
        ViolationTypeCatalog c1 = ReportModelFactory.eINSTANCE.createViolationTypeCatalog();
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ViolationType

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

Examples of org.emftrace.metamodel.ReportModel.ViolationType

   
    @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);
      assertEquals(0, accessLayer.getElements(project, "ConsistenceReport").size());
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ViolationType

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

Examples of org.emftrace.metamodel.ReportModel.ViolationType

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

Examples of org.emftrace.metamodel.ReportModel.ViolationType

      {
      @Override
      public Void call() throws Exception
      {
          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);
          assertEquals(0, accessLayer.getElements(project, "ConsistenceReport").size());
View Full Code Here

Examples of org.emftrace.metamodel.ReportModel.ViolationType

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

Examples of org.emftrace.metamodel.ReportModel.ViolationType

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

Examples of org.emftrace.metamodel.ReportModel.ViolationType

      Callable<Void> call = new Callable<Void>()
      {
      @Override
      public Void call() throws Exception
      {
            ViolationType t1 = ReportModelFactory.eINSTANCE.createViolationType();
            ViolationType t2 = ReportModelFactory.eINSTANCE.createViolationType();
           
            accessLayer.addElement(project, t1);
            accessLayer.addElement(project, t2);
           
            ViolationTypeCatalog c1 = ReportModelFactory.eINSTANCE.createViolationTypeCatalog();
           
            accessLayer.addElement(project, c1);
           
            c1.getViolationTypes().add(t1);
           
            assertEquals(1, c1.getViolationTypes().size());
            assertEquals(1, accessLayer.getElements(project, "ViolationTypeCatalog").size());
            assertEquals(2, accessLayer.getElements(project, "ViolationType").size());
            projectCleaner.cleanUpViolationTypeOrphans(project);
            assertEquals(1, c1.getViolationTypes().size());
            assertEquals(2, accessLayer.getElements(project, "ViolationType").size());
            assertEquals(2, accessLayer.getElements(project, "ViolationTypeCatalog").size());
           
            ViolationType t3 = ReportModelFactory.eINSTANCE.createViolationType();
            accessLayer.addElement(project, t3);
           
            assertEquals(3, accessLayer.getElements(project, "ViolationType").size());
            projectCleaner.cleanUpViolationTypeOrphans(project);
            assertEquals(3, accessLayer.getElements(project, "ViolationType").size());
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.