Package net.sourceforge.cobertura.coveragedata

Examples of net.sourceforge.cobertura.coveragedata.ProjectData


    @Test
    public void testPackageMerge() {
        PackageAndProjectData pOne = new PackageAndProjectData(
                buildOneCoverage(), "com.one");
        ProjectData two = new ProjectData();
        two.merge(pOne.getData());
        addSomeStuff(two, "bleep", 1);
        PackageAndProjectData pTwo = new PackageAndProjectData(two, "com.two");
        ProjectDataDifferenceCalculator dcalc = new ProjectDataDifferenceCalculator(
                two, pOne.getData());
        assertEquals(7, two.getNumberOfCoveredLines());
        assertEquals(1, dcalc.getDifference().getNumberOfCoveredLines());
        ProjectData three = new ProjectData();
        three.merge(two);
        addSomeStuff(three, "foo", 4);
        addSomeStuff(three, "blap", 5);
        assertEquals(three.getNumberOfCoveredLines(), 13);
        PackageAndProjectData pThree = new PackageAndProjectData(three,
                "com.one");
        List<PackageAndProjectData> x = new ArrayList<PackageAndProjectData>();
        x.add(new PackageAndProjectData(buildBaseProjectData(), "ignored"));
        x.add(pOne);
View Full Code Here


        return result;
    }
   
    public void saveChanges() {
        if (file != null) {
            ProjectData q = ref.get();
            CoverageDataFileHandler.saveCoverageData(q, file);
            ++saves;
        }
    }
View Full Code Here

        if ( ( dataFile == null ) || !dataFile.exists() )
        {
            throw new MojoExecutionException( "Unable to dump nonexistent dataFile [" + dataFile + "]" );
        }

        ProjectData projectData = CoverageDataFileHandler.loadCoverageData( dataFile );
        NumberFormat percentage = NumberFormat.getPercentInstance();
        NumberFormat integer = NumberFormat.getIntegerInstance();

        println( "<?xml version=\"1.0\"?>" );

        printProject( projectData, percentage, integer );

        Iterator it = projectData.getPackages().iterator();
        while ( it.hasNext() )
        {
            PackageData packageData = (PackageData) it.next();
            printPackage( percentage, integer, packageData );
        }
View Full Code Here

        this.dataFile = dataFile;
        if (forInstrumenting) {
            if (dataFile.exists()) {
                projectData = CoverageDataFileHandler.loadCoverageData(dataFile);
            } else {
                projectData = new ProjectData();
            }
        }
    }
View Full Code Here

    * @see org.jboss.arquillian.spi.event.suite.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
    */
   public void callback(Context context, Event event) throws Exception
   {
      // TODO: Need communication between Client and Server, https://jira.jboss.org/browse/ARQ-216
      ProjectData projectData = mergeCoverageFiles(new File(
            "/home/aslak/dev/source/testing/arquillian/frameworks/cobertura/target/report/"));
     
      synchronized (CoberturaWrapperAsset.PROJECT_DATA)
      {
         for(ProjectData assetData : CoberturaWrapperAsset.PROJECT_DATA)
         {
            projectData.merge(assetData);
         }
         CoberturaWrapperAsset.PROJECT_DATA.clear();
      }
      TouchCollector.applyTouchesOnProjectData(projectData);
     
View Full Code Here

      new HTMLReport(projectData, new File("target/coverage-report-html"), finder, complexity, "UTF-8");
   }

   private ProjectData mergeCoverageFiles(File outputDirectory)
   {
      ProjectData data = new ProjectData();
      File[] coverageFiles = outputDirectory.listFiles();
      for(File coverageFile : coverageFiles)
      {
         coverageFile.deleteOnExit();
         ProjectData snippet = CoverageDataFileHandler.loadCoverageData(coverageFile);
         data.merge(snippet);
      }
      return data;
   }
View Full Code Here

   /* (non-Javadoc)
    * @see org.jboss.arquillian.spi.event.suite.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
    */
   public void callback(Context context, ClassEvent event) throws Exception
   {
      ProjectData projectData = new ProjectData();
      TouchCollector.applyTouchesOnProjectData(projectData);
     
      // TODO: https://jira.jboss.org/browse/ARQ-216
      //context.get(ClientCommunicator.class).send(CoberturaClient.class, projectData);
     
View Full Code Here

      this.asset = asset;
   }
  
   public InputStream openStream()
   {
      ProjectData projectData = new ProjectData();
      PROJECT_DATA.add(projectData);
      try
      {
         InputStream inputStream = asset.openStream();
         ClassReader cr = new ClassReader(inputStream);
View Full Code Here

    private ProjectData coverageProjectData;

    public void initialize()
        throws InitializationException
    {
        this.coverageProjectData = new ProjectData();
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.cobertura.coveragedata.ProjectData

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.