Package org.jacoco.core.analysis

Examples of org.jacoco.core.analysis.Analyzer


  private ICounter analyze() {
    final CoverageBuilder builder = new CoverageBuilder();
    final ExecutionDataStore store = new ExecutionDataStore();
    runtime.collect(store, null, false);
    final Analyzer analyzer = new Analyzer(store, builder);
    analyzer.analyzeClass(reader);
    final Collection<IClassCoverage> classes = builder.getClasses();
    assertEquals(1, classes.size(), 0.0);
    final IClassCoverage classCoverage = classes.iterator().next();
    for (final IMethodCoverage m : classCoverage.getMethods()) {
      if (m.getName().equals("test")) {
View Full Code Here


  }

  private IBundleCoverage createBundle(final GroupElement group)
      throws IOException {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore, builder);
    for (final Iterator<?> i = group.classfiles.iterator(); i.hasNext();) {
      final Resource resource = (Resource) i.next();
      if (resource.isDirectory() && resource instanceof FileResource) {
        analyzer.analyzeAll(((FileResource) resource).getFile());
      } else {
        final InputStream in = resource.getInputStream();
        analyzer.analyzeAll(in);
        in.close();
      }
    }
    return builder.getBundle(group.name);
  }
View Full Code Here

public final class ClassInfo implements ICoverageVisitor {

  private final Analyzer analyzer;

  private ClassInfo() {
    analyzer = new Analyzer(new ExecutionDataStore(), this);
  }
View Full Code Here

public class ClassInfo implements ICoverageVisitor {

  private final Analyzer analyzer;

  private ClassInfo() {
    analyzer = new Analyzer(new ExecutionDataStore(), this);
  }
View Full Code Here

    }
  }

  private IBundleCoverage createBundle() throws IOException {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore, builder);
    final File classesDir = new File(getProject().getBuild()
        .getOutputDirectory());

    List<File> filesToAnalyze = getFilesToAnalyze(classesDir);

    for (File file : filesToAnalyze) {
      analyzer.analyzeAll(file);
    }

    return builder.getBundle(getProject().getName());
  }
View Full Code Here

  }

  private IBundleCoverage createBundle(final GroupElement group)
      throws IOException {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore, builder);
    for (final Iterator<?> i = group.classfiles.iterator(); i.hasNext();) {
      final Resource resource = (Resource) i.next();
      if (resource.isDirectory() && resource instanceof FileResource) {
        analyzer.analyzeAll(((FileResource) resource).getFile());
      } else {
        final InputStream in = resource.getInputStream();
        analyzer.analyzeAll(in);
        in.close();
      }
    }
    return builder.getBundle(group.name);
  }
View Full Code Here

  private ICounter analyze() {
    final CoverageBuilder builder = new CoverageBuilder();
    final ExecutionDataStore store = new ExecutionDataStore();
    runtime.collect(store, null, false);
    final Analyzer analyzer = new Analyzer(store, builder);
    analyzer.analyzeClass(reader);
    final Collection<IClassCoverage> classes = builder.getClasses();
    assertEquals(1, classes.size(), 0.0);
    final IClassCoverage classCoverage = classes.iterator().next();
    for (final IMethodCoverage m : classCoverage.getMethods()) {
      if (m.getName().equals("test")) {
View Full Code Here

    fis.close();
  }

  private IBundleCoverage analyzeStructure() throws IOException {
    final CoverageBuilder coverageBuilder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore,
        coverageBuilder);

    analyzer.analyzeAll(classesDirectory);

    return coverageBuilder.getBundle(title);
  }
View Full Code Here

    }
  }

  private IBundleCoverage createBundle() throws IOException {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore, builder);
    final File classesDir = new File(getProject().getBuild()
        .getOutputDirectory());
    analyzer.analyzeAll(classesDir);
    return builder.getBundle(getProject().getName());
  }
View Full Code Here

    }
  }

  private IBundleCoverage createBundle() throws IOException {
    final CoverageBuilder builder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionDataStore, builder);
    final File classesDir = new File(getProject().getBuild()
        .getOutputDirectory());

    final List<File> filesToAnalyze = getFilesToAnalyze(classesDir);

    for (final File file : filesToAnalyze) {
      analyzer.analyzeAll(file);
    }

    return builder.getBundle(getProject().getName());
  }
View Full Code Here

TOP

Related Classes of org.jacoco.core.analysis.Analyzer

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.